From patchwork Tue Jul 23 06:41:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13739449 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 8E5D6C3DA63 for ; Tue, 23 Jul 2024 06:46:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 179D96B00A9; Tue, 23 Jul 2024 02:46:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 12A536B00B9; Tue, 23 Jul 2024 02:46:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE5146B00BA; Tue, 23 Jul 2024 02:46:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id CE4FA6B00A9 for ; Tue, 23 Jul 2024 02:46:27 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 913431A16B9 for ; Tue, 23 Jul 2024 06:46:27 +0000 (UTC) X-FDA: 82370083614.14.4894920 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf19.hostedemail.com (Postfix) with ESMTP id 5D8BB1A0013 for ; Tue, 23 Jul 2024 06:46:24 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mh2GRPm2; spf=pass (imf19.hostedemail.com: domain of rppt@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721717162; a=rsa-sha256; cv=none; b=31lEs9BV9ZZXFgtJ5NdeOeFCy4wtHVn+6dwvnD67qKgECJyUex55wPAjnVGte+mdG7SrBv Me4PmYDFVufzlO5Pu3EEF/LM8aNcJFOry8d9+vvZ1zO4EyNMaEBvEjSMuXO8X/S6l5jc5h q38M3eA0IBgb+YjVv1zE+ndNwT3WXKg= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mh2GRPm2; spf=pass (imf19.hostedemail.com: domain of rppt@kernel.org designates 145.40.73.55 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=1721717162; 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=C3dNS8tmm9LuMgkByeluGpiI0uqfkNWTjzixbc7jZLI=; b=JhKdbTkRkmZfUjq0KSRRAoaNPMgtTovBn6sin1xgKdvDXAWGqXy8YC66Zw6yzdeUqjP0Un SAbGIOgUJwTTVn5FMrBo8r4q+Kt/liIb69xYFHuK2yCMhyKvzmlT1Y2rRhokZJjrwSjW0Q rlCW3hCV2a4TBOHBxnPNELJ6XGT24iU= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id C13F8CE0BBB; Tue, 23 Jul 2024 06:46:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17035C4AF0C; Tue, 23 Jul 2024 06:46:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721717182; bh=czQlSB1prAUx4+nfVbpfC7vYMDzPDxbO3yiJDWAcvGA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mh2GRPm2wBte19heLPPhCf25v4O8wId4t+XDdcLCfWpGv5PTkhss9ReUL8uazZULe 6eM8hQ+PWHhFnWT76FwkX2NWIgKyOpW3GylcxSfAvHhs0N7B5LuvANwWeCeqv+0nDx mhNPH8UgkiWp4VYIHXnZ1B4AFRHWcZw1ZlNwvtOAL0/JWEF+dZaXAkCexbuQgF77Kg MPc24q9PrvJh/gNzTjBu1XTMLLkvq6W+vGcmjsVIS4dX2Fgk3Bp7HPWIm4OA0YwdlJ shJ43oMYTjLQ/vbrZALQOA/kooXYb1d27NgGQfNNeu69CkjqYV2KsWm0OQI46bPrqY tFWPaODMjuktQ== 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 v2 21/25] mm: numa_memblks: make several functions and variables static Date: Tue, 23 Jul 2024 09:41:52 +0300 Message-ID: <20240723064156.4009477-22-rppt@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240723064156.4009477-1-rppt@kernel.org> References: <20240723064156.4009477-1-rppt@kernel.org> MIME-Version: 1.0 X-Stat-Signature: wy9si1tpny1ypgw5y6h3df9bjn1mbffe X-Rspamd-Queue-Id: 5D8BB1A0013 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1721717184-867089 X-HE-Meta: U2FsdGVkX18X1cMW4jiD3XHrxELPCX1QwL73gYCiUsOLBqS7mVNh73Ggap1x8Yj5FSjfqavG3tnBbSYRFrkI4Rountl88tp58yzaAmnu8AZ9SBQJcIpmUVhjN1BTD/wHWwd4OSex5MFlIx4G2MKFRDLrIdF1Bgb17nL4GdLXYrRrwPckKhHqtAkzHkrkmhLyhWTV47rbV5+zPEoMDZ3flbk6qPHV5fYtCWYqE0QgO8wH4P3fxyBRTtQIqjcEM1a/klxYqBUkVk7ls03W7IBN6WHYOTyvMnphqn8kKJqEv9wnIe1yoxt3J5kv/p9IZLS1QPN/OTBLpzSN1EXXFWliX26Flm+somrk11EEx11R1YL32VIzlC5/36ots64Tl8j6AB1xKoYJWln/JpVg4/FE9AqYhtRqb2KK6OqvFoclUUrxyrJsVC3mO3pxl6IBQK9EJ+HHUdS/wOSWd5043+petM9v570kgwTr64vVGHX2kN119pvO7eRWYz4bT9/vKrm/RLlOFNGwg8PdmtYLt5GLZXXMmmJy83tGEMXqT0Bjh61OKoD32OAIpeAqZrlrTt6ioSzrz/+fe0mNad7TB54gpXWjSmxEeefEcR1iYb7OC0oUAV/F9SgzbrziIQdNj9V4LztQWQs5kfEh6eZJmiuQcPvaGx7qkeLZv2niRB/7ElQiFFXg5rCs9XFpzFBb1Sdj/lME2oq44yrii9MXnfEZe7KVgOzm7DoCkg2AGEocN3V/+NZJVkOwfIOe6fMJskEEnUaLiY0lyyp4Aj7dZiB4vx2lzu60yWxyZitY0dIsT3MrJTpEUNVkQHf4nCr+ufXFguVOAvO3g+HjsZzC7BA30E+LFzDG0iZN/d7FBbRrEbsW68FkPNQcXm5LKixkIKHvURAFZLHpwYgMGoqjkoq7XxMuGa31jgRDQkMPifGcLuS1R9BGcJI0vJ9/oOFAxXGVtD1gm7Jhjj0uzyiKLqQ jIdrR6BQ ou7M2aws3S1PniklyEpOmdU5thXb9QPZFJ+jeBNGi0Br/7FuA4x/quSZh75NWI3vqNrLU26qK9oX7z4EZDRvAjR8L5UKziNSovCe1k4dcpHMSy+/ji4imszKD1C3FC8Z5G/Fd36SWl4lS0jXjadgF0xiSTj9eB5OgLYMNtSU7zPw6fBybtGezQgj0oo5r9rIhnF51g5Ds9dBfy1yvQt24XcX0D1DfEx+1Knk1sCzdH7WEdLAququto7kULzYI8exqTq2xnSa0FQ2mqXq8UYv3LfpJE0l+CT9STFhsrPrHxYsKEelntWvwC0itbVRlUPFMtfc+n6YSosD2QQ7NykIrk5tFwEyHDw59jGmmTP45S1+MBmo= 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) --- 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;