From patchwork Thu Aug 1 06:08:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13749754 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 67E2DC3DA64 for ; Thu, 1 Aug 2024 06:12:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D18946B00AF; Thu, 1 Aug 2024 02:12:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CA19D6B00BB; Thu, 1 Aug 2024 02:12:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AF2DF6B00BC; Thu, 1 Aug 2024 02:12:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 8B6346B00AF for ; Thu, 1 Aug 2024 02:12:55 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 42CF2408D8 for ; Thu, 1 Aug 2024 06:12:55 +0000 (UTC) X-FDA: 82402658310.24.C653234 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf12.hostedemail.com (Postfix) with ESMTP id 9AAAB40018 for ; Thu, 1 Aug 2024 06:12:53 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="QHe/KHJa"; spf=pass (imf12.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722492718; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=z4Xdi1PMf/vF/SAAM+e1Mcw/Wz7lRvNDJld1jWKVp1o=; b=NX0d9lLHkPf136o/qmzaYtuZAbzPRYZ91QRZqD3EYXpg/jdgqdCcUe4mcwOuiwzAWSM7EP n1Hwh1dSl4XOelNT0IeODVt7Vf7vlhhtQU6RnppZBZRnYp59+GjLQPbnVLiEMiWdpbB24i zbHFTrz00Qn1laEFHvq0Nu+elM3U9d8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722492718; a=rsa-sha256; cv=none; b=a1Qjk1gfArDKpX8tCXTBH/A5581O1fAGfSWluPywuga7hD1eCL9hlJQzeejVMu9GeoDWjB LP5hxwFk+bCAsary7o+S+j7l3BE1Gm++d/gyEk122mKxrir5y4NbMJgWKH/D26aVEz5zVj bWeBeMePaDe817F++bFyRKbX849QktY= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="QHe/KHJa"; spf=pass (imf12.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id DCF196140C; Thu, 1 Aug 2024 06:12:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 927C8C4AF12; Thu, 1 Aug 2024 06:12:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722492772; bh=Kiw+lzJCjsSsbhtIZxwLgv2SD/DXB55tpwh9QzdUDmc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QHe/KHJazM0v/nplwG5s3+ZVp/L2jgEbi1dAA7kI36bQHQxVX67pLYADN6L10kJez yB/53N0Q6hEdBC2SFahsylWI7nBaESLR3DQq2JsYEHiBImr934xtOyvm4Z+SfO8iQG LCkv8QIpMxgOYCqnzXm2hQ+RmGiMgU9Fy/sfAbU/d8mtdH0DJnmOPORi9XAhK9MrE4 lmeVablRXPU4gYsaPkvkeWWr/GbW4Dcgn54JwPrphIWIvmniKt3v3q5RtSdrip1m1m FhwTi4fe9PMGKjpCUukzkntyFCkMvHWoPk0cZQKJm2g1mBaf93NkCaLD4VAP1UMVr4 iTlOfkJLht9Zw== From: Mike Rapoport To: linux-kernel@vger.kernel.org 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 Cameron , Jonathan Corbet , Michael Ellerman , Mike Rapoport , Palmer Dabbelt , "Rafael J. Wysocki" , Rob Herring , Samuel Holland , Thomas Bogendoerfer , Thomas Gleixner , Vasily Gorbik , Will Deacon , Zi Yan , devicetree@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-cxl@vger.kernel.org, linux-doc@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, nvdimm@lists.linux.dev, sparclinux@vger.kernel.org, x86@kernel.org Subject: [PATCH v3 21/26] mm: numa_memblks: make several functions and variables static Date: Thu, 1 Aug 2024 09:08:21 +0300 Message-ID: <20240801060826.559858-22-rppt@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240801060826.559858-1-rppt@kernel.org> References: <20240801060826.559858-1-rppt@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 9AAAB40018 X-Stat-Signature: 9enqxip468h61cmoaayotmzjnrgdamp1 X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1722492773-251242 X-HE-Meta: U2FsdGVkX1/NgTCq5rwwPJOYgo2igoZy7v2uMvQOwUxco4RH6SMVeCfvA9quuBCXpFZTbSzSbzhRH/H2ELNh2FfIFyOQ5FoQdsRRL7ic41a+qVW4m9vLEvdrcO6eyP0NdO/EkSrM/RfOChtc0a+aRMbKA96qJQHnx9NA26nyeM0UPbdmka5vp2XbFI0bhC+oaFk8f4Ia0koL51djyVVJaYrw6FfH0DWYJwA7iIQenPfsJi+KLwlSgRa87UQ6oWfi3CGc/cMnCpG0Uw6W6492m5abX6iSjYSIVHijzzarYuGYc3APZh00nGgSJLe0YD9RimVOe3filHeCPbCGGySOMFuEIW8wCzUpXadG3NNgxWi/HebHuzPdkqh7Hmrw5qi71AESDPxo3Eq3y4pQQ98VDdO6AOnp0yEN1FKbMKQjhk9w9eh4VsOab54F1NsRTqhJBF0mrYBiOtCwLnU0/ZBBax9LotWPpHC8+mHYM6tayH7hQnW+bJ4VBWjsO5pEnJxBGLmh/xpwXJIM73hYrIcXvKm1biRae9hFiiHnhRUiM4D8CfQvHX9bVfVwX/HvvwbEhdCq0njOkNpUGvgNSY3LeYCkoRMz3e6Q283xYVZkz9nvUGX/XgLpnTHPULbbG6cZsIzXUcavY/+vPwaZNpfTF5pIOurlPKlDy+qCny8hESixfWWi9UF6d39glmymxfHkDayfB5c5nGSlmL8o2DxXLqTgPPT4ySHUnv8ESSvrKX0pekEL4VquLtqTW40AKN5jQ8S6YlAaeHn7juvB6CaAOeqHZZL6ps0pEH5aoJtTFD1mnU2TTviZC0yzkslIf0Ixaq5lZfdZZyK1BJe3an8LVj/eB5s3DSyTZwYYbaLDhDioW/Cv9ScRA8yW8WMm+8gnBVNWobmDjC6Ou2v45MePgiEb1bGxWzztNjGDeL91PGTLIGePdOe/i+MbtXbuahvPLrV0n7FuvbFlGrmJedz HwnfY1JY Smlq5cDyl11DXz227mCBA9yPLs6gLnAStEnvp0UuJacgh1iMs8ASOENFD51FkIUXxn99d5C1QTzr8jEYNZ4FvNofD4+xdr77FjMvMyKU/nwppsb8kg6d5Oktv/tGe1iXobmpxrUzm9NXIzW1Ltqd1MfLZ/3VxwMA2eusxL+zJQSzd7QuIa4kbEJEFUSoGPeSlr3XKeGKCag0thOUPEsjmEpHwaatYKaankvyQqP4wXAqnhKXtHdAO/YmHqJ4QUtG1nVEfXeV6/Ayw5Ox2w3jbvStu8tE69CUWngplzR/bDHC4pafR2w0LTTl0C2l1ZBzB26OKdC7S3/31jcMqxXwbvlCNICEOUiI+j50u 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: From: "Mike Rapoport (Microsoft)" Make functions and variables that are exclusively used by numa_memblks static. Move numa_nodemask_from_meminfo() before its callers to avoid forward declaration. Signed-off-by: Mike Rapoport (Microsoft) Tested-by: Zi Yan # for x86_64 and arm64 Reviewed-by: Jonathan Cameron Acked-by: David Hildenbrand --- include/linux/numa_memblks.h | 8 -------- mm/numa_memblks.c | 36 ++++++++++++++++++------------------ 2 files changed, 18 insertions(+), 26 deletions(-) diff --git a/include/linux/numa_memblks.h b/include/linux/numa_memblks.h index 07381320848f..5c6e12ad0b7a 100644 --- a/include/linux/numa_memblks.h +++ b/include/linux/numa_memblks.h @@ -7,7 +7,6 @@ #define NR_NODE_MEMBLKS (MAX_NUMNODES * 2) -extern int numa_distance_cnt; void __init numa_set_distance(int from, int to, int distance); void __init numa_reset_distance(void); @@ -22,17 +21,10 @@ struct numa_meminfo { struct numa_memblk blk[NR_NODE_MEMBLKS]; }; -extern struct numa_meminfo numa_meminfo __initdata_or_meminfo; -extern struct numa_meminfo numa_reserved_meminfo __initdata_or_meminfo; - int __init numa_add_memblk(int nodeid, u64 start, u64 end); void __init numa_remove_memblk_from(int idx, struct numa_meminfo *mi); int __init numa_cleanup_meminfo(struct numa_meminfo *mi); -int __init numa_register_meminfo(struct numa_meminfo *mi); - -void __init numa_nodemask_from_meminfo(nodemask_t *nodemask, - const struct numa_meminfo *mi); int __init numa_memblks_init(int (*init_func)(void), bool memblock_force_top_down); diff --git a/mm/numa_memblks.c b/mm/numa_memblks.c index 7749b6f6b250..e97665a5e8ce 100644 --- a/mm/numa_memblks.c +++ b/mm/numa_memblks.c @@ -7,13 +7,27 @@ #include #include -int numa_distance_cnt; +static int numa_distance_cnt; static u8 *numa_distance; nodemask_t numa_nodes_parsed __initdata; -struct numa_meminfo numa_meminfo __initdata_or_meminfo; -struct numa_meminfo numa_reserved_meminfo __initdata_or_meminfo; +static struct numa_meminfo numa_meminfo __initdata_or_meminfo; +static struct numa_meminfo numa_reserved_meminfo __initdata_or_meminfo; + +/* + * Set nodes, which have memory in @mi, in *@nodemask. + */ +static void __init numa_nodemask_from_meminfo(nodemask_t *nodemask, + const struct numa_meminfo *mi) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(mi->blk); i++) + if (mi->blk[i].start != mi->blk[i].end && + mi->blk[i].nid != NUMA_NO_NODE) + node_set(mi->blk[i].nid, *nodemask); +} /** * numa_reset_distance - Reset NUMA distance table @@ -290,20 +304,6 @@ int __init numa_cleanup_meminfo(struct numa_meminfo *mi) return 0; } -/* - * Set nodes, which have memory in @mi, in *@nodemask. - */ -void __init numa_nodemask_from_meminfo(nodemask_t *nodemask, - const struct numa_meminfo *mi) -{ - int i; - - for (i = 0; i < ARRAY_SIZE(mi->blk); i++) - if (mi->blk[i].start != mi->blk[i].end && - mi->blk[i].nid != NUMA_NO_NODE) - node_set(mi->blk[i].nid, *nodemask); -} - /* * Mark all currently memblock-reserved physical memory (which covers the * kernel's own memory ranges) as hot-unswappable. @@ -371,7 +371,7 @@ static void __init numa_clear_kernel_node_hotplug(void) } } -int __init numa_register_meminfo(struct numa_meminfo *mi) +static int __init numa_register_meminfo(struct numa_meminfo *mi) { int i;