Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1026777rdh; Fri, 24 Nov 2023 03:49:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IHmIbR7JwjzQcRJzAOEawbjEPSq1MBX0OWtIvw887ZaiEgM12lvoidhZA0Fxg3aQv6YiiIi X-Received: by 2002:a05:6a20:6a07:b0:18a:6639:e331 with SMTP id p7-20020a056a206a0700b0018a6639e331mr7758882pzk.13.1700826593235; Fri, 24 Nov 2023 03:49:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700826593; cv=none; d=google.com; s=arc-20160816; b=Mw9kh5AVph9VfrJhQiz/alcq5XkMwtwzVJsr7YrDtymdeMsO5ouYUJ1daJhu50jBou o4xf5Qz7ZxVTbT/ff3FITkTFhJmbmJIUKfvb/du4kQc0CdFmjumk684HG1aEuRJR3Uj2 Zn9WZUN+M7v57PXh+kof1ZNNRTluIpxNpnu6L4FxC0/AHOJHXBfsWCU1mSAEfKrh0/dT 5U9cCFq5B5Oud8EZvl9fwiQzfWsmKHs34Z37auZJCvF2OBSG3F/kf7VJD8Dxgvv3jqd+ +M/samjYltioylPIESS3t5jKgT48O0KF1oO5hdacPLbeedHsEPxVNQgbRuEgjFoY3T0Q k1LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=/GVBBL4H1f3YA10oRq+uNqKV01r+TfJc+k6TGhRau4A=; fh=yeTCAC5/pDqekBNkmd2z+Zmey9SZ3PESK+uYmkpvnrU=; b=QfMuWpzuRYJeJ+uX+ChIqjGpzgKNd+XswI6P+4XNJ5ybSc9j05xI8nUayOomEdOYZC dLxeYbyFfNjPbZmct4nmYFF7DjiOSm5jUwaA8i+ajlATQhTyl66SPmK68bkdLu0b/dfM ckI39f755wh4omSEq0Cc359OwhC9rVJhi9CHHqiuOfjr182XwDwBdaYzCZ3YWQZ7CzB3 8hwVIjk45driQGfR4ADc4EQNV/w0whicg3GY7YVsKSQlqwVEiQ/Ka9ScisS4mBM2u/Ot vXfrCmHJbHW99nHSpQ3ktOvHWzWO4vBnzlqajaHU5X5GMZqV770ObhiIJ46j79ZjxqGJ /WtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id e15-20020a631e0f000000b005ab6142f1besi3484637pge.169.2023.11.24.03.49.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 03:49:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 8A4638032F9E; Fri, 24 Nov 2023 03:47:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230303AbjKXLrg (ORCPT + 99 others); Fri, 24 Nov 2023 06:47:36 -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> X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 24 Nov 2023 03:47:51 -0800 (PST) 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