From: Peter Zijlstra Date: Wed, 3 Apr 2024 07:50:07 +0000 (+0200) Subject: sched/fair: Cleanup pick_task_fair() vs throttle X-Git-Tag: v6.12-rc1~120^2~41 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=8e2e13ac6122915bd98315237b0317495e391be0;p=linux-block.git sched/fair: Cleanup pick_task_fair() vs throttle Per 54d27365cae8 ("sched/fair: Prevent throttling in early pick_next_task_fair()") the reason check_cfs_rq_runtime() is under the 'if (curr)' check is to ensure the (downward) traversal does not result in an empty cfs_rq. But then the pick_task_fair() 'copy' of all this made it restart the traversal anyway, so that seems to solve the issue too. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Ben Segall Reviewed-by: Valentin Schneider Tested-by: Valentin Schneider Link: https://lkml.kernel.org/r/20240727105028.501679876@infradead.org --- diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8201f0f4e709..7ba1ca56a63e 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8471,11 +8471,11 @@ again: update_curr(cfs_rq); else curr = NULL; - - if (unlikely(check_cfs_rq_runtime(cfs_rq))) - goto again; } + if (unlikely(check_cfs_rq_runtime(cfs_rq))) + goto again; + se = pick_next_entity(cfs_rq); cfs_rq = group_cfs_rq(se); } while (cfs_rq);