linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Joel Fernandes (Google)" <joelaf@google.com>
To: linux-kernel@vger.kernel.org
Cc: "Joel Fernandes (Google)" <joel@joelfernandes.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Morten Ramussen <morten.rasmussen@arm.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Patrick Bellasi <patrick.bellasi@arm.com>,
	Rohit Jain <rohit.k.jain@oracle.com>,
	kernel-team@android.com
Subject: [PATCH v2] sched: Remove obscure comment from select_task_rq_fair
Date: Sun, 27 May 2018 18:24:47 -0700	[thread overview]
Message-ID: <20180528012447.115411-1-joel@joelfernandes.org> (raw)

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:
dump_stack+0x46/0x5b
select_task_rq_fair+0x101d/0x1030
sched_exec+0x4f/0xc0
do_execveat_common.isra.41+0x1e3/0x7c0
__x64_sys_execve+0x2d/0x40
do_syscall_64+0x43/0xf0
entry_SYSCALL_64_after_hwframe+0x44/0xa9

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 <dietmar.eggemann@arm.com>
Cc: Morten Ramussen <morten.rasmussen@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Patrick Bellasi <patrick.bellasi@arm.com>
Cc: Rohit Jain <rohit.k.jain@oracle.com>
Cc: kernel-team@android.com
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
---
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) {
 pick_cpu:
-		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)
-- 
2.17.0.921.gf22659ad46-goog

             reply	other threads:[~2018-05-28  1:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-28  1:24 Joel Fernandes (Google) [this message]
2018-05-28  7:15 ` [PATCH v2] sched: Remove obscure comment from select_task_rq_fair Peter Zijlstra
2018-05-28 20:54   ` Joel Fernandes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180528012447.115411-1-joel@joelfernandes.org \
    --to=joelaf@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=joel@joelfernandes.org \
    --cc=juri.lelli@redhat.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=morten.rasmussen@arm.com \
    --cc=patrick.bellasi@arm.com \
    --cc=peterz@infradead.org \
    --cc=rohit.k.jain@oracle.com \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).