LKML Archive on
help / color / mirror / Atom feed
* [PATCH v2] sched: Remove obscure comment from select_task_rq_fair
@ 2018-05-28  1:24 Joel Fernandes (Google)
  2018-05-28  7:15 ` Peter Zijlstra
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Fernandes (Google) @ 2018-05-28  1:24 UTC (permalink / raw)
  To: linux-kernel
  Cc: Joel Fernandes (Google),
	Dietmar Eggemann, Morten Ramussen, Ingo Molnar, Peter Zijlstra,
	Juri Lelli, Vincent Guittot, Patrick Bellasi, Rohit Jain,

I was playing with cpusets and sched_load_balance flag and notice that
the fast-path (select_idle_sibling) can also be attempted for
exec-balance, not just wake-balance if the waker cpu's cpuset has
sched_load_balance = 0. This patch removes the obscure comment which was
saying this path can be entered only for wake-balance.

To trigger this, I just do:
mkdir /cpuset
mount -t cpuset none /cpuset
echo 0 > sched_load_balance

Then did some random activity and dumped the stack from 'if (!sd)' for
the non wake-balance cases.

Following is one of the stacks:

Turns out the same case occurs also during boot up when kthreadd tries
to create threads before domains are attached so lets fix the comment.

Cc: Dietmar Eggemann <>
Cc: Morten Ramussen <>
Cc: Ingo Molnar <>
Cc: Peter Zijlstra <>
Cc: Juri Lelli <>
Cc: Vincent Guittot <>
Cc: Patrick Bellasi <>
Cc: Rohit Jain <>
Signed-off-by: Joel Fernandes (Google) <>
v1->v2: Resending without "XXX" in subject since otherwise LKML thinks
its junk.

 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 54dc31e7ab9b..dd07794141d0 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6665,7 +6665,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f
 	if (!sd) {
-		if (sd_flag & SD_BALANCE_WAKE) { /* XXX always ? */
+		if (sd_flag & SD_BALANCE_WAKE) {
 			new_cpu = select_idle_sibling(p, prev_cpu, new_cpu);
 			if (want_affine)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-28 20:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-28  1:24 [PATCH v2] sched: Remove obscure comment from select_task_rq_fair Joel Fernandes (Google)
2018-05-28  7:15 ` Peter Zijlstra
2018-05-28 20:54   ` Joel Fernandes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).