sched: don't account throttle time for empty groups
authorJosh Don <joshdon@google.com>
Tue, 20 Jun 2023 18:32:46 +0000 (11:32 -0700)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 13 Jul 2023 13:21:49 +0000 (15:21 +0200)
commit79462e8c879afc7895b30014d31e2c1fd629bb1f
treee892190700d63aa4386c2c8d729010b786a4540e
parent893cdaaa3977be6afb3a7f756fbfd7be83f68d8c
sched: don't account throttle time for empty groups

It is easy for a cfs_rq to become throttled even when it has no enqueued
entities (for example, if we have just put_prev()'d the last runnable
task of the cfs_rq, and the cfs_rq is out of quota).

Avoid accounting this time towards total throttle time, since it
otherwise falsely inflates the stats.

Note that the dequeue path is special, since we normally disallow
migrations when a task is in a throttled hierarchy (see
throttled_lb_pair()).

Signed-off-by: Josh Don <joshdon@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230620183247.737942-1-joshdon@google.com
kernel/sched/fair.c