From: Ingo Molnar <mingo@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Qian Cai <quic_qiancai@quicinc.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Daniel Bristot de Oliveira <bristot@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Borislav Petkov <bp@alien8.de>,
Thomas Gleixner <tglx@linutronix.de>,
"Huang, Ying" <ying.huang@intel.com>
Subject: Re: [GIT PULL] scheduler updates for v5.18
Date: Tue, 22 Mar 2022 08:48:31 +0100 [thread overview]
Message-ID: <Yjl/T0SBCo1zfkkS@gmail.com> (raw)
In-Reply-To: <Yjl8Lk2uPiZkXoM9@gmail.com>
* Ingo Molnar <mingo@kernel.org> wrote:
>
> * Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
> > On Mon, Mar 21, 2022 at 6:13 AM Qian Cai <quic_qiancai@quicinc.com> wrote:
> > >
> > > On Mon, Mar 21, 2022 at 11:54:09AM +0100, Ingo Molnar wrote:
> > > > Huang Ying (3):
> > > > sched/numa-balancing: Move some document to make it consistent with the code
> > > > sched/numa: Fix NUMA topology for systems with CPU-less nodes
> > > > sched/numa: Avoid migrating task to CPU-less node
> > >
> > > Linus, I don't think you want to merge this as-is. This will introduce a
> > > kernel crash on arm64 NUMA as mentioned in this thread,
> >
> > Ok, dropped from my queue. Thanks,
>
> I've reverted the broken commit & will send another pull request after
> some testing. Sorry about that!
Ended up using the fix below instead - it's tested already on the affected
system.
Thanks,
Ingo
=================>
From: "Huang, Ying" <ying.huang@intel.com>
Date: Tue, 22 Mar 2022 08:39:22 +0100
Subject: [PATCH] sched/numa: Fix boot crash on arm64 systems
Qian Cai reported a boot crash on arm64 systems, caused by:
0fb3978b0aac ("sched/numa: Fix NUMA topology for systems with CPU-less nodes")
The bug is that node_state() must be supplied a valid node_states[] array index,
but in task_numa_placement() the max_nid search can fail with NUMA_NO_NODE,
which is not a valid index.
Fix it by checking that max_nid is a valid index.
[ mingo: Added changelog. ]
Fixes: 0fb3978b0aac ("sched/numa: Fix NUMA topology for systems with CPU-less nodes")
Reported-by: Qian Cai <quic_qiancai@quicinc.com>
Tested-by: Qian Cai <quic_qiancai@quicinc.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
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 89d21fda106c..ee0664c9d291 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2437,7 +2437,7 @@ static void task_numa_placement(struct task_struct *p)
}
/* Cannot migrate task to CPU-less node */
- if (!node_state(max_nid, N_CPU)) {
+ if (max_nid != NUMA_NO_NODE && !node_state(max_nid, N_CPU)) {
int near_nid = max_nid;
int distance, near_distance = INT_MAX;
next prev parent reply other threads:[~2022-03-22 7:48 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-21 10:54 [GIT PULL] scheduler updates for v5.18 Ingo Molnar
2022-03-21 13:13 ` Qian Cai
2022-03-21 23:59 ` Huang, Ying
2022-03-22 0:18 ` Linus Torvalds
2022-03-22 0:54 ` Huang, Ying
2022-03-22 1:08 ` Linus Torvalds
2022-03-22 7:35 ` Ingo Molnar
2022-03-22 7:48 ` Ingo Molnar [this message]
2022-03-22 8:18 ` Huang, Ying
2022-03-22 11:07 ` Ingo Molnar
2022-03-21 15:44 ` Nathan Chancellor
2022-03-22 7:54 ` Ingo Molnar
2022-03-22 15:32 ` Nathan Chancellor
2022-03-22 15:39 ` Randy Dunlap
2022-03-22 11:10 ` [GIT PULL -v2] " Ingo Molnar
2022-03-22 23:27 ` pr-tracker-bot
2022-03-22 23:27 ` [GIT PULL] " pr-tracker-bot
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=Yjl/T0SBCo1zfkkS@gmail.com \
--to=mingo@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=peterz@infradead.org \
--cc=quic_qiancai@quicinc.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=vincent.guittot@linaro.org \
--cc=ying.huang@intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.