]> Git Repo - linux.git/commit
sched/fair: Fix O(nr_cgroups) in load balance path
authorTejun Heo <[email protected]>
Wed, 26 Apr 2017 00:43:50 +0000 (17:43 -0700)
committerIngo Molnar <[email protected]>
Mon, 15 May 2017 10:07:44 +0000 (12:07 +0200)
commita9e7f6544b9cebdae54d29f87a7ba2a83c0471b5
treea09967d1b29ac8716d4f636985679359cb4795ea
parent502ce005ab95d5d9481768649dbab808845b24d7
sched/fair: Fix O(nr_cgroups) in load balance path

Currently, rq->leaf_cfs_rq_list is a traversal ordered list of all
live cfs_rqs which have ever been active on the CPU; unfortunately,
this makes update_blocked_averages() O(# total cgroups) which isn't
scalable at all.

This shows up as a small CPU consumption and scheduling latency
increase in the load balancing path in systems with CPU controller
enabled across most cgroups.  In an edge case where temporary cgroups
were leaking, this caused the kernel to consume good several tens of
percents of CPU cycles running update_blocked_averages(), each run
taking multiple millisecs.

This patch fixes the issue by taking empty and fully decayed cfs_rqs
off the rq->leaf_cfs_rq_list.

Signed-off-by: Tejun Heo <[email protected]>
[ Added cfs_rq_is_decayed() ]
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Acked-by: Vincent Guittot <[email protected]>
Cc: Chris Mason <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Turner <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
kernel/sched/fair.c
This page took 0.05854 seconds and 4 git commands to generate.