From patchwork Thu Aug 1 06:08:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13749631 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 648A6C3DA4A for ; Thu, 1 Aug 2024 06:09:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A06376B0089; Thu, 1 Aug 2024 02:09:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9B74D6B008A; Thu, 1 Aug 2024 02:09:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 87EC76B008C; Thu, 1 Aug 2024 02:09:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 695C56B0089 for ; Thu, 1 Aug 2024 02:09:14 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id E196E1608E4 for ; Thu, 1 Aug 2024 06:09:13 +0000 (UTC) X-FDA: 82402648986.05.A2218AB Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf11.hostedemail.com (Postfix) with ESMTP id 336254000A for ; Thu, 1 Aug 2024 06:09:12 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=UlXPnIkk; spf=pass (imf11.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722492523; a=rsa-sha256; cv=none; b=knYZnEuzIPWVVDeu6Lkj0VPF4ycZ+HMxQtO7gFqUHkjrLRsUsnSQwwlGkvmINCMD+CIWzm N65Q2kIcS5jIBTKFsjVmIvutqBiZcFwydiJVEfhuKaQx8Oe8n5gskThKajPMf1tUb4Frtz /7TQr0dyGHNmsKjJuMqkBS/FGuW9pV4= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=UlXPnIkk; spf=pass (imf11.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=1722492523; 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=mpDA7GewTCgHjnhlaK2zN79CV/6fdKT07FqjCbVF80I=; b=35+ADEu3My7e3EI9j0KAvtEfzk0IRj5RDofJijE/H/3E8E51NKgx3XWynW7bJhcqnBC7at PqtMXd2ciHd9+HX8OYFiBzkQ7VjX+bzhoh4n5gwTG/LsL0vZwymXNz4XCm4PzaqbXI7toT dWZ8wNiVv7WbHrjxKmnsRpntP4wPYMU= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 31D6E61B43; Thu, 1 Aug 2024 06:09:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D56BCC4AF0E; Thu, 1 Aug 2024 06:08:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722492550; bh=wE9udk3T5PUOzWhffSqfqF0jfi91yVWMRgCuaEhaWIs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UlXPnIkkZQR2dXJRdGRF6ypg+KOsiM9/67c6rYYrhDo2FguVGlVV8shyU7Gz8VzYr +u4Ya4vP+UoPOnxh6t1MSmRl1cHJ08bQvMpxgJIkc9zewWuRHTWoiilbb7qKzEj/Ma RD1tGKdlLTPrJaG8ZEblPomDJdXVPP7dAGf4NXPs+5wYFBxEN5X0Hp589/maJAgny+ TIWDD/cr8uy0CHdC8oTDx0a0OUfJcsPttk+4G1CzKYSKRQW3M5bjNgPSdfPRy3HQTZ ASefzpnG9NOh2q5N+dfBb4Hi3WipAZUAo6fBCWwI90MfToAMZrVqzzDByoyHFMeEDu vLoDKbCBr6w0g== 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 02/26] MIPS: sgi-ip27: make NODE_DATA() the same as on all other architectures Date: Thu, 1 Aug 2024 09:08:02 +0300 Message-ID: <20240801060826.559858-3-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-Stat-Signature: iipxwf5u7nbtqicwntqx1eocbpozb16d X-Rspamd-Queue-Id: 336254000A X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1722492552-74209 X-HE-Meta: U2FsdGVkX1+VvxsYYAt7iAcwEGA4lwvenDj5ZyKGqVEjwhVBT8b3RUXxUIutX9Q1deOEsgCEQdlUKpbRPa+DxwmJDl62v4Ql2G95nDISltkKOHY/EXwyLw55gVJj9xXssv4VKW9SY+dsB3cDlH4Q4Em5u3YrVhGs3p58OGnXWEaf9w4D6h5oSo3CGCSNdUq6eR8goauOVTGIwhkrMNWBor5wTQD5/hPMQ8Ga5KKCj2sS/MAz00CMjfhsT56Tbb1zs/2ijI32ZnXVuzzCRJUd05JGfaFvJUXl3Ft3o1GIWcQV9KrL7CWsXUhgl2Yd35g69ZgeA9iVovqdqD6oYb08a7APkmFIeWdg5doFDiGYId3sjcTSjt8lP61JW7rA3KOcAMeE0FQrVBleAOfLaD92BCoj3njXm0mspOmII0LFnuC+65Il2xRMmNPERSrwS5J8rUnaENCcPOSj+3yAvlO3a14cQMJbonT9fQvkyn+lCwIMOi6zXZpxWqCaSuudiCFeAZQox3bdUnZk7WQWQS8xS1mLAOjwgOvtH2uWlp2XePsbzLN3X4G+YKXZlWwP8kNwaOTRpC3uZSdZ60Qo9vFLUthJfD8uUXE5hK6jLhHHqNjQEhqoJeTeIAjiU+C+VDDrHTCp+S2ibcmp70Mn0Dz+kOYkUZqteA3LBroeFLF9uDAxlrW8JkcVBCAdEMWJWglLATTpC82YXnomSEfPHjDOm2ygnBWjT/VnL3rKYqGxBeCH3SG5X8gO0e+93iqFDOGQS2IQlSd7Zf6u225XZ9lUPUHrGDEXNbfhopgw/xOZHv5sZlEiWHqf9t/NWJw7tOoH+1dClfUcv8SxkO3X0qgIVv7vONH//sQ0a/YOobkUeS+DPYFKohAI+5y258XsIaX6c3tCtJrBOPfjw95sSRs5Wp8iDvZKVazRpVdhC+/UtQ3EitDgmm/mYboQuTo/lfESNmSrrSK003RunpPM3OU WI1DQMf2 bkd2bo8t2TYvEwyWBHyoAD8MjGd82q1rUxcGNwL/wHc+Z3omReUdZGjt/WWqVg97g729t8pFJoHMHwPs9MnrmOnaFLxCsgoIsV/wDSt8SPo2am+ezw/8RWxlgm1aBVwnTDQDNV0hz7T1HkcR9y3MZniob5iP8LlEIHyCqCkgXwSM06purtLDiCyzipSauyVYVVb3M0PEyV1Yu95IDD8E78uNpb5sVHFrNSjZMTBpaS0G3gpBQNl7mfrskVBNU23Aorhsi4fI+93s9vnPN0h0fjU+FljCZ5EiaUmQYisHJur+tWf+QGVNPzqXBXRJVWbODTkDmUfVbsC9h/lXZ4N4n1leeVivzBX4U9A8MZ5dSfFE35/2VehMy9zSal2NfT+N2ofLzNGnKYZLnjLEww7oS3dG/Gg== 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)" sgi-ip27 is the only system that defines NODE_DATA() differently than the rest of NUMA machines. Add node_data array of struct pglist pointers that will point to __node_data[node]->pglist and redefine NODE_DATA() to use node_data array. This will allow pulling declaration of node_data to the generic mm code in the next commit. Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Jonathan Cameron Acked-by: David Hildenbrand --- arch/mips/include/asm/mach-ip27/mmzone.h | 5 ++++- arch/mips/sgi-ip27/ip27-memory.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/mach-ip27/mmzone.h b/arch/mips/include/asm/mach-ip27/mmzone.h index 08c36e50a860..629c3f290203 100644 --- a/arch/mips/include/asm/mach-ip27/mmzone.h +++ b/arch/mips/include/asm/mach-ip27/mmzone.h @@ -22,7 +22,10 @@ struct node_data { extern struct node_data *__node_data[]; -#define NODE_DATA(n) (&__node_data[(n)]->pglist) #define hub_data(n) (&__node_data[(n)]->hub) +extern struct pglist_data *node_data[]; + +#define NODE_DATA(nid) (node_data[nid]) + #endif /* _ASM_MACH_MMZONE_H */ diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c index b8ca94cfb4fe..c30ef6958b97 100644 --- a/arch/mips/sgi-ip27/ip27-memory.c +++ b/arch/mips/sgi-ip27/ip27-memory.c @@ -34,8 +34,10 @@ #define SLOT_PFNSHIFT (SLOT_SHIFT - PAGE_SHIFT) #define PFN_NASIDSHFT (NASID_SHFT - PAGE_SHIFT) -struct node_data *__node_data[MAX_NUMNODES]; +struct pglist_data *node_data[MAX_NUMNODES]; +EXPORT_SYMBOL(node_data); +struct node_data *__node_data[MAX_NUMNODES]; EXPORT_SYMBOL(__node_data); static u64 gen_region_mask(void) @@ -361,6 +363,7 @@ static void __init node_mem_init(nasid_t node) */ __node_data[node] = __va(slot_freepfn << PAGE_SHIFT); memset(__node_data[node], 0, PAGE_SIZE); + node_data[node] = &__node_data[node]->pglist; NODE_DATA(node)->node_start_pfn = start_pfn; NODE_DATA(node)->node_spanned_pages = end_pfn - start_pfn;