Commit 8e2e13ac authored by Peter Zijlstra's avatar Peter Zijlstra
Browse files

sched/fair: Cleanup pick_task_fair() vs throttle



Per 54d27365 ("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: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: default avatarBen Segall <bsegall@google.com>
Reviewed-by: default avatarValentin Schneider <vschneid@redhat.com>
Tested-by: default avatarValentin Schneider <vschneid@redhat.com>
Link: https://lkml.kernel.org/r/20240727105028.501679876@infradead.org
parent 949090ea
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -8471,10 +8471,10 @@ static struct task_struct *pick_task_fair(struct rq *rq)
				update_curr(cfs_rq);
			else
				curr = NULL;
		}

		if (unlikely(check_cfs_rq_runtime(cfs_rq)))
			goto again;
		}

		se = pick_next_entity(cfs_rq);
		cfs_rq = group_cfs_rq(se);