]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
sched/fair: Cleanup pick_task_fair() vs throttle
authorPeter Zijlstra <peterz@infradead.org>
Wed, 3 Apr 2024 07:50:07 +0000 (09:50 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Sat, 17 Aug 2024 09:06:40 +0000 (11:06 +0200)
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) <peterz@infradead.org>
Reviewed-by: Ben Segall <bsegall@google.com>
Reviewed-by: Valentin Schneider <vschneid@redhat.com>
Tested-by: Valentin Schneider <vschneid@redhat.com>
Link: https://lkml.kernel.org/r/20240727105028.501679876@infradead.org
kernel/sched/fair.c

index 8201f0f4e709505d53793da9213a14d7e398620c..7ba1ca56a63efe23ed4c053da2f0f871f3b339fb 100644 (file)
@@ -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);