aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched_fair.c
diff options
context:
space:
mode:
authorPaul Turner <pjt@google.com>2011-07-21 12:43:28 -0400
committerIngo Molnar <mingo@elte.hu>2011-08-14 06:03:20 -0400
commitab84d31e15502fb626169ba2663381e34bf965b2 (patch)
tree658ce7caa6199aa74c5feea92ec8d3e9a2cb4296 /kernel/sched_fair.c
parent953bfcd10e6f3697233e8e5128c611d275da39c1 (diff)
sched: Introduce primitives to account for CFS bandwidth tracking
In this patch we introduce the notion of CFS bandwidth, partitioned into globally unassigned bandwidth, and locally claimed bandwidth. - The global bandwidth is per task_group, it represents a pool of unclaimed bandwidth that cfs_rqs can allocate from. - The local bandwidth is tracked per-cfs_rq, this represents allotments from the global pool bandwidth assigned to a specific cpu. Bandwidth is managed via cgroupfs, adding two new interfaces to the cpu subsystem: - cpu.cfs_period_us : the bandwidth period in usecs - cpu.cfs_quota_us : the cpu bandwidth (in usecs) that this tg will be allowed to consume over period above. Signed-off-by: Paul Turner <pjt@google.com> Signed-off-by: Nikhil Rao <ncrao@google.com> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Reviewed-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/20110721184756.972636699@google.com Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched_fair.c')
-rw-r--r--kernel/sched_fair.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index f86b0cb5eb29..f24f4171019d 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -1234,6 +1234,22 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued)
1234 check_preempt_tick(cfs_rq, curr); 1234 check_preempt_tick(cfs_rq, curr);
1235} 1235}
1236 1236
1237
1238/**************************************************
1239 * CFS bandwidth control machinery
1240 */
1241
1242#ifdef CONFIG_CFS_BANDWIDTH
1243/*
1244 * default period for cfs group bandwidth.
1245 * default: 0.1s, units: nanoseconds
1246 */
1247static inline u64 default_cfs_period(void)
1248{
1249 return 100000000ULL;
1250}
1251#endif
1252
1237/************************************************** 1253/**************************************************
1238 * CFS operations on tasks: 1254 * CFS operations on tasks:
1239 */ 1255 */