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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6B01C3DA59 for ; Fri, 19 Jul 2024 15:51:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5E5CE6B0092; Fri, 19 Jul 2024 11:51:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 596C36B0095; Fri, 19 Jul 2024 11:51:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 45D336B0096; Fri, 19 Jul 2024 11:51:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 288D06B0092 for ; Fri, 19 Jul 2024 11:51:53 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 8A003120736 for ; Fri, 19 Jul 2024 15:51:52 +0000 (UTC) X-FDA: 82356942864.23.DC4198F Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by imf26.hostedemail.com (Postfix) with ESMTP id 230E714000C for ; Fri, 19 Jul 2024 15:51:49 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=none; spf=pass (imf26.hostedemail.com: domain of jonathan.cameron@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=jonathan.cameron@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721404290; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E2TkHv8hVg1nex5tWodo/lKnr9W1nFP/yBNQeu3LKtk=; b=oXIQOyqqrPYJW23pZblCPnzT2rMYho5uOZYUdSYPxoCVTvX0lJ1BOHOhqEDbSwNiwFEMQH coZ9ytqX0MKh3RT2tSG5fCB9jUrAyMiiAPxtHyYEwsTNsNJZY/YsgplAL9D+JaClOj8NvT UhlX9lsPOmeZugi/9r+XGuKaYs6myEk= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=none; spf=pass (imf26.hostedemail.com: domain of jonathan.cameron@huawei.com designates 185.176.79.56 as permitted sender) smtp.mailfrom=jonathan.cameron@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721404290; a=rsa-sha256; cv=none; b=s9j5uk5UiLJPRVXzdF26Vquj7IMSIsB+mSR/Gn8ELLlku3cWyk2LqIZnmKWWH4LMmlAH8w NX/Ieu+czkdMGUGrsztb/U8rcmN/9Y9O5Yv85NfDUyVb2XdYxe+ZBXqzAh6r8kLEdaob3S 2Hz9dvfyXRN7tEJILSMteQ70Jmi+TlY= Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4WQYyl1P08z6J67T; Fri, 19 Jul 2024 23:49:51 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id BC470140517; Fri, 19 Jul 2024 23:51:45 +0800 (CST) Received: from localhost (10.48.157.16) 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, 19 Jul 2024 16:51:44 +0100 Date: Fri, 19 Jul 2024 16:51:43 +0100 From: Jonathan Cameron To: David Hildenbrand CC: Mike Rapoport , , "Alexander Gordeev" , Andreas Larsson , Andrew Morton , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Christophe Leroy , Dan Williams , Dave Hansen , "David S. Miller" , Greg Kroah-Hartman , Heiko Carstens , "Huacai Chen" , Ingo Molnar , Jiaxun Yang , John Paul Adrian Glaubitz , Michael Ellerman , Palmer Dabbelt , "Rafael J. Wysocki" , Rob Herring , Thomas Bogendoerfer , Thomas Gleixner , "Vasily Gorbik" , Will Deacon , , , , , , , , , , , , , , , Subject: Re: [PATCH 05/17] arch, mm: pull out allocation of NODE_DATA to generic code Message-ID: <20240719165143.0000002e@Huawei.com> In-Reply-To: <96850252-a49f-4d78-a94b-a9a25e3f2bd5@redhat.com> References: <20240716111346.3676969-1-rppt@kernel.org> <20240716111346.3676969-6-rppt@kernel.org> <220da8ed-337a-4b1e-badf-2bff1d36e6c3@redhat.com> <96850252-a49f-4d78-a94b-a9a25e3f2bd5@redhat.com> 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 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.48.157.16] X-ClientProxiedBy: lhrpeml100006.china.huawei.com (7.191.160.224) To lhrpeml500005.china.huawei.com (7.191.163.240) X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 230E714000C X-Stat-Signature: gtjmw8wmkp5e71f9eoyatjopsan8skc5 X-HE-Tag: 1721404309-216665 X-HE-Meta: U2FsdGVkX1+x1F2DA/Sukg0gKUza0dcUT45eVyPFfHoieUMRF4S9jCgtSJmU1FsCajplfSdjljSByDufbPNmU/h+dUbfIsfwIxNbMZtqc6n1o3tnozXzZbsb4IGZBCt+czgNVMbuhh2jOSp6NpB99J2xiJ3YVsreNC7PK7zWqdD2g2QYQmOfeIrmY0LcOZZhOm2l3vo9OaSLZXcXMfM/SqIPYF+xZOcu5lmOYWVsg3ESZtpzXPTat410JwNBp5hQO/3JS/r305/Ds2ELPJzsRc3vJuZNiT4j1CI9D+Dh0syMwU6MqTNY6ZlaaHbGALUhQ+hlLyTj22nVg9apM0Erq4ELwbzP+bKiqxRI5VJpz/z8zm1srgAblZNkRvq8UxDJAsHdtSfTI6yhihxo+3XzqwnEYR95g+bsI+v04ayFD9snap+u7QiTiDYfEFR/KTJsQRppFMP+3pKZBfLIMCyJvQRm6Ryz8vah+5DSfFXQ9zxCYs30qnG8A/mEfO5S/i7LNnymTAATK4piD6H9EpWrezyvOCUi+Njh9BHJO+jwRus7BtKxh+/mwvnn9LddG4vRSl8VpljBHsvhDjUKelc2F6RcAmZbGqckOQgcUKSNooobENfXBqhPyNpN/Azi3RFxxCumW4kRRAS02f07v8CWH+za82j6DfLOKkncm4fptqnmKKu+vWBgd2z5PxfaeVbNsqFi9Zs+aMwfceZnqHa4VFX8f1kAGpjVgeuaLgAzLsJaEaV7/zqXFlP/dBsLn4H1t/2Xdq8AZso/ga0deAPMlZZZzPQDJJRdt5ofC/A+VO8ZfI0VcogNqIxAcUYAyvT6XYhjZYi057d2D3kGfUnu3RG8SdDukkYaw2yLSykvOUgW8vVLCOCjCrxHEV3FMRjRSOI58lmiqSEn3ybUir1xzN/6623H8DR5lEu0w60AtuJ25Uel4GociJ4RoJzqA5drOLmszeefn2XarHcOGjn 7+G0HzTF LENYvAAmHjPZqVXt/2MLUJ28B8jeeVyR+jukETj5Lpi8wynpY9rFd0+3iz55StUbnToZ/0Z9P+/m2fAqajPZgIrYkwU27hrBIE3VIIWWhum6budVeA8tGHKhsollmZhmYqmga+NBnW7WRdzFOO/5Ku3hdTnduVWu7UBlk7CEbyexERhN5EJly9WIWptddWq9zg50TO6SCDHBGBEOf7zABHm+eXfa8EC9FCsXDtOruXTwAzWXsk/9Lml5F1jYW2ZO8RfvymUZY2TMURka1M9R/tgzM3Q== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Fri, 19 Jul 2024 17:07:35 +0200 David Hildenbrand wrote: > >>> - * Allocate node data. Try node-local memory and then any node. > >>> - * Never allocate in DMA zone. > >>> - */ > >>> - nd_pa = memblock_phys_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid); > >>> - if (!nd_pa) { > >>> - pr_err("Cannot find %zu bytes in any node (initial node: %d)\n", > >>> - nd_size, nid); > >>> - return; > >>> - } > >>> - nd = __va(nd_pa); > >>> - > >>> - /* report and initialize */ > >>> - printk(KERN_INFO "NODE_DATA(%d) allocated [mem %#010Lx-%#010Lx]\n", nid, > >>> - nd_pa, nd_pa + nd_size - 1); > >>> - tnid = early_pfn_to_nid(nd_pa >> PAGE_SHIFT); > >>> - if (tnid != nid) > >>> - printk(KERN_INFO " NODE_DATA(%d) on node %d\n", nid, tnid); > >>> - > >>> - node_data[nid] = nd; > >>> - memset(NODE_DATA(nid), 0, sizeof(pg_data_t)); > >>> - > >>> - node_set_online(nid); > >>> -} > >>> - > >>> /** > >>> * numa_cleanup_meminfo - Cleanup a numa_meminfo > >>> * @mi: numa_meminfo to clean up > >>> @@ -571,6 +538,7 @@ static int __init numa_register_memblks(struct numa_meminfo *mi) > >>> continue; > >>> alloc_node_data(nid); > >>> + node_set_online(nid); > >>> } > >> > >> I can spot that we only remove a single node_set_online() call from x86. > >> > >> What about all the other architectures? Will there be any change in behavior > >> for them? Or do we simply set the nodes online later once more? > > > > On x86 node_set_online() was a part of alloc_node_data() and I moved it > > outside so it's called right after alloc_node_data(). On other > > architectures the allocation didn't include that call, so there should be > > no difference there. > > But won't their arch code try setting the nodes online at a later stage? > > And I think, some architectures only set nodes online conditionally > (see most other node_set_online() calls). > > Sorry if I'm confused here, but with now unconditional node_set_online(), won't > we change the behavior of other architectures? This is moving x86 code to x86 code, not a generic location so how would that affect anyone else? Their onlining should be same as before. The node onlining difference are a pain (I recall that fun from adding generic initiators) as different ordering on x86 and arm64 at least. Jonathan >