Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp1582650pxa; Fri, 28 Aug 2020 17:40:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWHEE/IxaBKMt5rrS4HpmPVNoNVyl3HwSiu1fv/Tx88SAug8kTyE0PYRwJ9HSxyTPSYMAE X-Received: by 2002:a17:906:74de:: with SMTP id z30mr1395102ejl.478.1598661652756; Fri, 28 Aug 2020 17:40:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598661652; cv=none; d=google.com; s=arc-20160816; b=fpj7HUwIStldJ/I5lW/Lf4UsruIRAA041amzbmnCQz4nJVcEa6xw8LCfiA+wp3XByH a8kEuBR92Qpx90YNO+wk3JHvR2491NhpUFKOkZUAV25Yu8WP04Q5pa2QIZ0d4/BOu4sk I4xRCbnlNoDQck0XLGyhsdokyhPvYdh4fVZciVf3xRZhRNJ5BX0QRchlPqS/eW8QkhmC eGY/Iu8ewdxito26e7FG5wV3zA8bPwiPvSsdk9mOeeShx8YFmGLPvqadQ7z+D/KTu97U JI4aQo43PZ4nz71qc8iTF3/Huy39upjbIt3vWG61eHJYnCSRyNF2MoOxVXfRi4jBV5e8 TSEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=HhE6WCMtoODE6GixkR8pydA91xEbZ/J3fzi8jE92LeQ=; b=hT4aGkH4LDqtxNKhqlFVrtDw9YsEzSjtQ2xMhWzsia/wvQ5evTdEyqadj/vKOy8BHl moKi/DmEXEVn1Gz+XUKQ2KGq9cO1atMVPc06/wOSzk4pMXXwBQFHqEjhmaMvKslptODn N6DB2UfxIFgk8e5Vx8E79Q+qpBDmJSzTroXRU6LB7O9YRrCgOWZlVlZLefyJTZalXrtw bnDBO0RRrRbmI5tGmOnY/Rgy0Iabg6/6vaCd94cZjDF5pfduVmcOVnPNOTAU9BHNcn9b gvXY5nuMoSdUx1v+2VqhURhAtTAqSH6AdEuT5vWWfHt7adhWgBoIh6ev139P+zOhgtDP HQuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@atishpatra.org header.s=google header.b=W3VcIZ+W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bn6si826926ejb.74.2020.08.28.17.40.29; Fri, 28 Aug 2020 17:40:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@atishpatra.org header.s=google header.b=W3VcIZ+W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726859AbgH2Aji (ORCPT + 99 others); Fri, 28 Aug 2020 20:39:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726584AbgH2Ajg (ORCPT ); Fri, 28 Aug 2020 20:39:36 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 256E3C061264 for ; Fri, 28 Aug 2020 17:39:35 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id t14so673863wmi.3 for ; Fri, 28 Aug 2020 17:39:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atishpatra.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HhE6WCMtoODE6GixkR8pydA91xEbZ/J3fzi8jE92LeQ=; b=W3VcIZ+WwFndRykg27fx4UwALNDRxc9RatRjzx7ZvrQZe2WZyBz5d9Qk8gbY6k5nP0 VNVusIAIKoqjHjrvMf0/H2HPGej8mwfncRIL13Axvz2nZKO5BKP3UmCTbH4313mWm4fS 5YweDpx+M2Y0s/WGcou3WIQ38u9L3DGvBCOmo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HhE6WCMtoODE6GixkR8pydA91xEbZ/J3fzi8jE92LeQ=; b=O1pIAMwLftA8tD8g50bHXY1lUsm25tzJgg1s0RjC6UEFjjmJ//S0VJYYgV59RA7aKK FdL3l1CA994ophU6t/K1uNXm+2gzFvMj/iHqlQs0xuMfIU2G+WNGH2Ljfgj3splzpiAm 1U2urd7hMZlyeaQJtjmSCFCevIyCnN4esKytkK9GSb/9WoTnKvRhNVgeiiBzl04P83Yd NNju1mH7l817zI/zjn6Erh7STE7I52GWBMHDUilX9rjKLzULbCjv8kaXvvhBJd3un4mt 2QPJfCJQvU6CFrYDQO97gBvjUWk6D5IZHTdrsq+DEKYCOMxylULBxDLao/WGtiuXZ1GE /+2w== X-Gm-Message-State: AOAM5307Iy9HQYIUZFaw9i/P1s2gIfZhiqQxE68Wis4lgDDaBqRto9ea TFDoCNOWgplZ+HUXMe/aF3kkcMvKPTfv2vBvvrL0 X-Received: by 2002:a05:600c:230f:: with SMTP id 15mr1019525wmo.186.1598661573584; Fri, 28 Aug 2020 17:39:33 -0700 (PDT) MIME-Version: 1.0 References: <20200814214725.28818-1-atish.patra@wdc.com> <20200814214725.28818-3-atish.patra@wdc.com> <20200828103552.000033e3@Huawei.com> In-Reply-To: <20200828103552.000033e3@Huawei.com> From: Atish Patra Date: Fri, 28 Aug 2020 17:39:22 -0700 Message-ID: Subject: Re: [RFC/RFT PATCH 2/6] arm64, numa: Change the numa init function name to be generic To: Jonathan Cameron Cc: Atish Patra , "Rafael J. Wysocki" , Catalin Marinas , Zong Li , linux-riscv , Will Deacon , linux-arch@vger.kernel.org, Rob Herring , Lorenzo Pieralisi , Ganapatrao Kulkarni , Steven Price , Greentime Hu , Albert Ou , Arnd Bergmann , Anshuman Khandual , Paul Walmsley , "linux-arm-kernel@lists.infradead.org" , Nick Hu , Greg Kroah-Hartman , Anup Patel , "linux-kernel@vger.kernel.org List" , Palmer Dabbelt , Andrew Morton , Mike Rapoport Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 28, 2020 at 2:37 AM Jonathan Cameron wrote: > > On Fri, 14 Aug 2020 14:47:21 -0700 > Atish Patra wrote: > > > As we are using generic numa implementation code, modify the init function > > name to indicate that generic implementation. > > > > Signed-off-by: Atish Patra > > --- > > arch/arm64/mm/init.c | 4 ++-- > > drivers/base/arch_numa.c | 8 ++++++-- > > include/asm-generic/numa.h | 4 ++-- > > 3 files changed, 10 insertions(+), 6 deletions(-) > > > > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c > > index 481d22c32a2e..93b660229e1d 100644 > > --- a/arch/arm64/mm/init.c > > +++ b/arch/arm64/mm/init.c > > @@ -418,10 +418,10 @@ void __init bootmem_init(void) > > max_pfn = max_low_pfn = max; > > min_low_pfn = min; > > > > - arm64_numa_init(); > > + arch_numa_init(); > > > > /* > > - * must be done after arm64_numa_init() which calls numa_init() to > > + * must be done after arch_numa_init() which calls numa_init() to > > * initialize node_online_map that gets used in hugetlb_cma_reserve() > > * while allocating required CMA size across online nodes. > > */ > > diff --git a/drivers/base/arch_numa.c b/drivers/base/arch_numa.c > > index 73f8b49d485c..83341c807240 100644 > > --- a/drivers/base/arch_numa.c > > +++ b/drivers/base/arch_numa.c > > @@ -13,7 +13,9 @@ > > #include > > #include > > > > +#ifdef CONFIG_ARM64 > > #include > > +#endif > > This highlights an issue. We really don't want to define 'generic' arch > code then match on individual architectures if at all possible. > I agree. > I'm also not sure we need to. > > The arm64_acpi_numa_init() code is just a light wrapper around the > standard acpi_init() call so should work fine on riscv (once ACPI > support is ready). > > Can we pull that function into here Sure. We can move the arm64_acpi_numa_init to here and rename it to arch_acpi_numa_init. We can keep arch_acpi_numa_init and the acpi.h included under CONFIG_ACPI_NUMA. If RISC-V becomes ACPI ready one day, they always need to enable CONFIG_ACPI_NUMA and reuse the generic functions. > or perhaps a generic arch_numa_acpi.c? > There has not been much discussion about ACPI for RISC-V. So moving the arm64 acpi code now to generic code would be premature in my opinion. Currently, we don't even know how ACPI will look like for RISC-V. > There is probably a bit of a dance needed around acpi_disabled > though as that can be defined in entirely different places > depending on whether acpi is enabled or not. > Possibly just adding an > > extern int acpi_disabled to include/linux/acpi.h when acpi is enabled > will be sufficient (if ugly)? > We don't need to do that now unless we are moving arm64 ACPI code implementation to generic code. If ACPI is not enabled, it is already defined as a macro in include/linux/acpi.h. > > > #include > > > > struct pglist_data *node_data[MAX_NUMNODES] __read_mostly; > > @@ -445,16 +447,18 @@ static int __init dummy_numa_init(void) > > } > > > > /** > > - * arm64_numa_init() - Initialize NUMA > > + * arch_numa_init() - Initialize NUMA > > * > > * Try each configured NUMA initialization method until one succeeds. The > > * last fallback is dummy single node config encomapssing whole memory. > > */ > > -void __init arm64_numa_init(void) > > +void __init arch_numa_init(void) > > { > > if (!numa_off) { > > +#ifdef CONFIG_ARM64 > > if (!acpi_disabled && !numa_init(arm64_acpi_numa_init)) > > return; > > +#endif > > if (acpi_disabled && !numa_init(of_numa_init)) > > return; > > } > > diff --git a/include/asm-generic/numa.h b/include/asm-generic/numa.h > > index 0635c0724b7c..309eca8c0b5d 100644 > > --- a/include/asm-generic/numa.h > > +++ b/include/asm-generic/numa.h > > @@ -27,7 +27,7 @@ static inline const struct cpumask *cpumask_of_node(int node) > > } > > #endif > > > > -void __init arm64_numa_init(void); > > +void __init arch_numa_init(void); > > int __init numa_add_memblk(int nodeid, u64 start, u64 end); > > void __init numa_set_distance(int from, int to, int distance); > > void __init numa_free_distance(void); > > @@ -41,7 +41,7 @@ void numa_remove_cpu(unsigned int cpu); > > static inline void numa_store_cpu_info(unsigned int cpu) { } > > static inline void numa_add_cpu(unsigned int cpu) { } > > static inline void numa_remove_cpu(unsigned int cpu) { } > > -static inline void arm64_numa_init(void) { } > > +static inline void arch_numa_init(void) { } > > static inline void early_map_cpu_to_node(unsigned int cpu, int nid) { } > > > > #endif /* CONFIG_NUMA */ > > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv -- Regards, Atish