]> git.baikalelectronics.ru Git - kernel.git/commit
sched/numa: Fix boot crash on arm64 systems
authorHuang, Ying <ying.huang@intel.com>
Tue, 22 Mar 2022 07:39:22 +0000 (08:39 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 22 Mar 2022 07:49:22 +0000 (08:49 +0100)
commit11292e81592385ff4e533c75fb8de0d23651cf2b
treee924fd304530194eaab0b4b30361f6170206bdee
parent83d818fc5453d0084c0c382fdcf253d83cdbef35
sched/numa: Fix boot crash on arm64 systems

Qian Cai reported a boot crash on arm64 systems, caused by:

  32e75fd71201 ("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: 32e75fd71201 ("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>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: "Huang, Ying" <ying.huang@intel.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/fair.c