17093c32f6
[ Upstream commit 75b5e0bf90bffaca4b1f19114065dc59f5cc161f ] In current code, init_irq_stacks() will call cpu_to_node(). The cpu_to_node() depends on percpu "numa_node" which is initialized in: arch_call_rest_init() --> rest_init() -- kernel_init() --> kernel_init_freeable() --> smp_prepare_cpus() But init_irq_stacks() is called in init_IRQ() which is before arch_call_rest_init(). So in init_irq_stacks(), the cpu_to_node() does not work, it always return 0. In NUMA, it makes the node 1 cpu accesses the IRQ stack which is in the node 0. This patch fixes it by: 1.) export the early_cpu_to_node(), and use it in the init_irq_stacks(). 2.) change init_irq_stacks() to __init function. Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Huang Shijie <shijie@os.amperecomputing.com> Link: https://lore.kernel.org/r/20231124031513.81548-1-shijie@os.amperecomputing.com Signed-off-by: Will Deacon <will@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> |
||
---|---|---|
.. | ||
bitops | ||
vdso | ||
Kbuild | ||
asm-offsets.h | ||
asm-prototypes.h | ||
atomic.h | ||
atomic64.h | ||
audit_change_attr.h | ||
audit_dir_write.h | ||
audit_read.h | ||
audit_signal.h | ||
audit_write.h | ||
barrier.h | ||
bitops.h | ||
bitsperlong.h | ||
bug.h | ||
cache.h | ||
cacheflush.h | ||
checksum.h | ||
cmpxchg-local.h | ||
cmpxchg.h | ||
compat.h | ||
current.h | ||
delay.h | ||
device.h | ||
div64.h | ||
dma-mapping.h | ||
dma.h | ||
early_ioremap.h | ||
emergency-restart.h | ||
error-injection.h | ||
exec.h | ||
export.h | ||
extable.h | ||
fb.h | ||
fixmap.h | ||
flat.h | ||
ftrace.h | ||
futex.h | ||
getorder.h | ||
gpio.h | ||
hardirq.h | ||
hugetlb.h | ||
hw_irq.h | ||
hyperv-tlfs.h | ||
ide_iops.h | ||
int-ll64.h | ||
io.h | ||
ioctl.h | ||
iomap.h | ||
irq.h | ||
irq_regs.h | ||
irq_work.h | ||
irqflags.h | ||
kdebug.h | ||
kmap_size.h | ||
kprobes.h | ||
kvm_para.h | ||
kvm_types.h | ||
linkage.h | ||
local.h | ||
local64.h | ||
logic_io.h | ||
mcs_spinlock.h | ||
memory_model.h | ||
mm_hooks.h | ||
mmiowb.h | ||
mmiowb_types.h | ||
mmu.h | ||
mmu_context.h | ||
module.h | ||
module.lds.h | ||
mshyperv.h | ||
msi.h | ||
nommu_context.h | ||
numa.h | ||
page.h | ||
param.h | ||
parport.h | ||
pci.h | ||
pci_iomap.h | ||
percpu.h | ||
pgalloc.h | ||
pgtable-nop4d.h | ||
pgtable-nopmd.h | ||
pgtable-nopud.h | ||
pgtable_uffd.h | ||
preempt.h | ||
qrwlock.h | ||
qrwlock_types.h | ||
qspinlock.h | ||
qspinlock_types.h | ||
resource.h | ||
rwonce.h | ||
seccomp.h | ||
sections.h | ||
serial.h | ||
set_memory.h | ||
shmparam.h | ||
signal.h | ||
simd.h | ||
softirq_stack.h | ||
spinlock.h | ||
statfs.h | ||
string.h | ||
switch_to.h | ||
syscall.h | ||
syscalls.h | ||
termios-base.h | ||
termios.h | ||
timex.h | ||
tlb.h | ||
tlbflush.h | ||
topology.h | ||
trace_clock.h | ||
uaccess.h | ||
unaligned.h | ||
user.h | ||
vermagic.h | ||
vga.h | ||
vmlinux.lds.h | ||
vtime.h | ||
word-at-a-time.h | ||
xor.h |