From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC907C61DF4 for ; Fri, 24 Nov 2023 11:47:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230345AbjKXLrh (ORCPT ); Fri, 24 Nov 2023 06:47:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbjKXLrf (ORCPT ); Fri, 24 Nov 2023 06:47:35 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DA2FD68 for ; Fri, 24 Nov 2023 03:47:42 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85693C433C9; Fri, 24 Nov 2023 11:47:40 +0000 (UTC) Date: Fri, 24 Nov 2023 11:47:38 +0000 From: Catalin Marinas To: Huang Shijie Cc: will@kernel.org, gregkh@linuxfoundation.org, rafael@kernel.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Subject: Re: [PATCH v4] arm64: irq: set the correct node for VMAP stack Message-ID: References: <20231124031513.81548-1-shijie@os.amperecomputing.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231124031513.81548-1-shijie@os.amperecomputing.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Signed-off-by: Huang Shijie > --- > 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