Lines Matching refs:period
923 usec_t cgroup_cpu_adjust_period(usec_t period, usec_t quota, usec_t resolution, usec_t max_period) { in cgroup_cpu_adjust_period() argument
929 return MIN(MAX3(period, resolution, resolution * USEC_PER_SEC / quota), max_period); in cgroup_cpu_adjust_period()
932 static usec_t cgroup_cpu_adjust_period_and_log(Unit *u, usec_t period, usec_t quota) { in cgroup_cpu_adjust_period_and_log() argument
939 if (period == USEC_INFINITY) in cgroup_cpu_adjust_period_and_log()
941 period = CGROUP_CPU_QUOTA_DEFAULT_PERIOD_USEC; in cgroup_cpu_adjust_period_and_log()
944 new_period = cgroup_cpu_adjust_period(period, quota, USEC_PER_MSEC, USEC_PER_SEC); in cgroup_cpu_adjust_period_and_log()
946 if (new_period != period) { in cgroup_cpu_adjust_period_and_log()
963 static void cgroup_apply_unified_cpu_quota(Unit *u, usec_t quota, usec_t period) { in cgroup_apply_unified_cpu_quota() argument
966 period = cgroup_cpu_adjust_period_and_log(u, period, quota); in cgroup_apply_unified_cpu_quota()
969 MAX(quota * period / USEC_PER_SEC, USEC_PER_MSEC), period); in cgroup_apply_unified_cpu_quota()
971 xsprintf(buf, "max " USEC_FMT "\n", period); in cgroup_apply_unified_cpu_quota()
982 static void cgroup_apply_legacy_cpu_quota(Unit *u, usec_t quota, usec_t period) { in cgroup_apply_legacy_cpu_quota() argument
985 period = cgroup_cpu_adjust_period_and_log(u, period, quota); in cgroup_apply_legacy_cpu_quota()
987 xsprintf(buf, USEC_FMT "\n", period); in cgroup_apply_legacy_cpu_quota()
991 xsprintf(buf, USEC_FMT "\n", MAX(quota * period / USEC_PER_SEC, USEC_PER_MSEC)); in cgroup_apply_legacy_cpu_quota()