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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D398AC3DA4A for ; Fri, 2 Aug 2024 09:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Nmf4WgEOBG8BeZ4/qkvSEjSFuWjqINbHpvPTdZmNPOA=; b=LMDS73dBZn4eT2 sYvH4Y4PCKo+qUGAlQmcUlvvN63LsiJh9LmC5CX+NZFnSd8XGjI4rR6pWyEntnDYz1sbbK7xnbJo/ 2C2cDsOTY47TOPuRZQ9yWdl6xHnVY0XdkVBNkiXRdnulrHpkYdCuzkDR+WRhrAWuep2MFor/Wt2oJ xtFfxZ+LGxiVw/+c0+a68XvPPpUofSoYZg0/YZYSyuo6z+kosKTE2E9KJRqmpeHNSs7z/+NiiNvGa Di1xZAomSKloddlk4PQkd46lioQjUyFok1iY8TDZ8zu5SLgVYDl0ZTv5Iy06ES4UQoj5qy/qVog9r IrezWIJYVla9Wpv01SAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZp16-00000008MiK-2JhX; Fri, 02 Aug 2024 09:56:08 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZp0a-00000008MW5-2lWi; Fri, 02 Aug 2024 09:55:38 +0000 Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Wb1NN08c9z6K99q; Fri, 2 Aug 2024 17:52:52 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 51A73140A86; Fri, 2 Aug 2024 17:55:29 +0800 (CST) Received: from localhost (10.203.177.66) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Fri, 2 Aug 2024 10:55:28 +0100 Date: Fri, 2 Aug 2024 10:55:27 +0100 From: Jonathan Cameron To: Mike Rapoport CC: , Alexander Gordeev , Andreas Larsson , "Andrew Morton" , Arnd Bergmann , "Borislav Petkov" , Catalin Marinas , Christophe Leroy , Dan Williams , Dave Hansen , David Hildenbrand , "David S. Miller" , Davidlohr Bueso , "Greg Kroah-Hartman" , Heiko Carstens , Huacai Chen , Ingo Molnar , Jiaxun Yang , "John Paul Adrian Glaubitz" , Jonathan Corbet , Michael Ellerman , Palmer Dabbelt , "Rafael J. Wysocki" , Rob Herring , Samuel Holland , Thomas Bogendoerfer , Thomas Gleixner , "Vasily Gorbik" , Will Deacon , Zi Yan , , , , , , , , , , , , , , , , Subject: Re: [PATCH v3 09/26] arch, mm: pull out allocation of NODE_DATA to generic code Message-ID: <20240802105527.00005240@Huawei.com> In-Reply-To: <20240801060826.559858-10-rppt@kernel.org> References: <20240801060826.559858-1-rppt@kernel.org> <20240801060826.559858-10-rppt@kernel.org> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 X-Originating-IP: [10.203.177.66] X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240802_025537_007514_E9212C1F X-CRM114-Status: GOOD ( 18.89 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Thu, 1 Aug 2024 09:08:09 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" > > Architectures that support NUMA duplicate the code that allocates > NODE_DATA on the node-local memory with slight variations in reporting > of the addresses where the memory was allocated. > > Use x86 version as the basis for the generic alloc_node_data() function > and call this function in architecture specific numa initialization. > > Round up node data size to SMP_CACHE_BYTES rather than to PAGE_SIZE like > x86 used to do since the bootmem era when allocation granularity was > PAGE_SIZE anyway. > > Signed-off-by: Mike Rapoport (Microsoft) > Acked-by: David Hildenbrand > Reviewed-by: Jonathan Cameron > Tested-by: Zi Yan # for x86_64 and arm64 One comment unrelated to this patch set as such, just made more obvious by it. > diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c > index 0744a9a2944b..3c1da08304d0 100644 > --- a/arch/powerpc/mm/numa.c > +++ b/arch/powerpc/mm/numa.c > @@ -1093,27 +1093,9 @@ void __init dump_numa_cpu_topology(void) > static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn) > { > u64 spanned_pages = end_pfn - start_pfn; Trivial, but might as well squash this local variable into the single place it's used. > - const size_t nd_size = roundup(sizeof(pg_data_t), SMP_CACHE_BYTES); > - u64 nd_pa; > - void *nd; > - int tnid; > - > - nd_pa = memblock_phys_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid); > - if (!nd_pa) > - panic("Cannot allocate %zu bytes for node %d data\n", > - nd_size, nid); > - > - nd = __va(nd_pa); > - > - /* report and initialize */ > - pr_info(" NODE_DATA [mem %#010Lx-%#010Lx]\n", > - nd_pa, nd_pa + nd_size - 1); > - tnid = early_pfn_to_nid(nd_pa >> PAGE_SHIFT); > - if (tnid != nid) > - pr_info(" NODE_DATA(%d) on node %d\n", nid, tnid); > - > - node_data[nid] = nd; > - memset(NODE_DATA(nid), 0, sizeof(pg_data_t)); > + > + alloc_node_data(nid); > + > NODE_DATA(nid)->node_id = nid; > NODE_DATA(nid)->node_start_pfn = start_pfn; > NODE_DATA(nid)->node_spanned_pages = spanned_pages; _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv