[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yjl/T0SBCo1zfkkS@gmail.com>
Date: Tue, 22 Mar 2022 08:48:31 +0100
From: Ingo Molnar <mingo@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Qian Cai <quic_qiancai@...cinc.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Borislav Petkov <bp@...en8.de>,
Thomas Gleixner <tglx@...utronix.de>,
"Huang, Ying" <ying.huang@...el.com>
Subject: Re: [GIT PULL] scheduler updates for v5.18
* Ingo Molnar <mingo@...nel.org> wrote:
>
> * Linus Torvalds <torvalds@...ux-foundation.org> wrote:
>
> > On Mon, Mar 21, 2022 at 6:13 AM Qian Cai <quic_qiancai@...cinc.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@...el.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@...cinc.com>
Tested-by: Qian Cai <quic_qiancai@...cinc.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Signed-off-by: Ingo Molnar <mingo@...nel.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;
Powered by blists - more mailing lists