lkml.org 
[lkml]   [2023]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4] arm64: irq: set the correct node for VMAP stack
On Fri, Nov 24, 2023 at 11:15:13AM +0800, Huang Shijie wrote:
> 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>
> ---
> v3 --> v4:
> 1.) keep early_cpu_to_node() as __init function.
> 2.) change init_irq_stacks() to __init function.
>
> ---
> arch/arm64/kernel/irq.c | 5 +++--
> drivers/base/arch_numa.c | 2 +-
> include/asm-generic/numa.h | 2 ++
> 3 files changed, 6 insertions(+), 3 deletions(-)

Greg, Rafael - any objections to taking this patch through the arm64
tree?

--
Catalin

\
 
 \ /
  Last update: 2023-11-24 12:48    [W:0.619 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site