From patchwork Tue Jul 23 06:41:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13739429 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 8E363C3DA63 for ; Tue, 23 Jul 2024 06:42:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 128A16B008C; Tue, 23 Jul 2024 02:42:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0FF7D6B0092; Tue, 23 Jul 2024 02:42:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F086A6B0093; Tue, 23 Jul 2024 02:42:43 -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 CDA646B008C for ; Tue, 23 Jul 2024 02:42:43 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 41DEA81CC4 for ; Tue, 23 Jul 2024 06:42:43 +0000 (UTC) X-FDA: 82370074206.30.4CEAF87 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf14.hostedemail.com (Postfix) with ESMTP id 95CF0100004 for ; Tue, 23 Jul 2024 06:42:41 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=L4fNJ84X; spf=pass (imf14.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=1721716916; 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=mDgySPmpZBhYC7R31qSHu9IXDrIHCO+gEmOL1gOIRGY9SB+H5daiiYpMXgFDqEvGEyaERI NUqWZWKIOAqfOyPkHJ2Z0A1KxxrnOp/dOZ/JOGHPqVvryu/viwNuofY3nVa8b2qYb3N0Ms 6MtfLc90xgLwX61NiY/rrSeldxkBswM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721716916; a=rsa-sha256; cv=none; b=1wnnxnZnn4QXVpTKfffP0WDhXlb/JfcQIvI1rSvIW4VLcYR63Tqu+NnM+SKXYb5U2Lkp8/ XnjxxMDkxNyqc4S1s/ryujnvj64PkleQGIHfcEBzoJhuhGErZ98rv5dnTWDFPtqcKU7krC 8iHVftHyAMeYronqD3yn9kvRreFEZJo= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=L4fNJ84X; spf=pass (imf14.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 B5DE060B98; Tue, 23 Jul 2024 06:42:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65428C4AF09; Tue, 23 Jul 2024 06:42:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721716960; bh=wE9udk3T5PUOzWhffSqfqF0jfi91yVWMRgCuaEhaWIs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L4fNJ84X321lZQzRVwm/9NQS5NvRjUpsrvUknu/25CNWvxfQJeLO5JGwoMu66FrNE yvDUpLniReSKqIGbvqtVRByoS59WWzegjXjEaI/pSrYNABzkWG217PFiU/HwCkFTUq g5LaEICTajd27yc9CaZWhZMte2v93pqn/oc7mWi2RjQwmIaj9fD9pBiOpgfGeAY97T Oe4NEENOMypP8RnZtX4JhQBHzOIYuexn1Vt8ZCQFxdsT1om7AChjHOPoOQjfy6zd24 JMhzIfEW86NpfX+IthkEOW0SXal75QemXF5ziyXOa5gbgR3IX+M2Vk2vL97MmOTzDj iYFpZ/HwvvjKw== 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 02/25] MIPS: sgi-ip27: make NODE_DATA() the same as on all other architectures Date: Tue, 23 Jul 2024 09:41:33 +0300 Message-ID: <20240723064156.4009477-3-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-Rspamd-Queue-Id: 95CF0100004 X-Stat-Signature: j3whr5okhy798cqjmkymg6w4q9syjpzz X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1721716961-22162 X-HE-Meta: U2FsdGVkX1/QbjFG3pPwvy1GWIKcTIxJgv08Oarg4omFQuOXHCIrLpzJO0p2gPUUrrakdadooN4bsB+TnVJr+3jlCffl/Le0ABOBhiZfTUhSG+3NGbwWABwiE376K1Wb2lLSZW2Yl7tRkD34UXfVG6CzjHvRtXmZfdCgZl4K8WpXfOEPbCNloMbdLAapNsDhqvqqJ62UvkLuslfe0PXFnQKpY2+VdnH+2qBZv/yhRxpIit6yAXYHADcN/5oEf6tuaxrBqgL98YSKraC0YdVP7Ay5Ewsyi34aWq4/izDEyaEQkzjWN3x7OuCDcRNYtokJ5M+yjclTV+DPYvDYRAM7AvvboVU6fbkKxXOLHr2GVGXCojlaT57HNWjF1klRgHTQXNLUJNF1z33T1ZuZsX2ez/JWvP8ncb76lSFuGLjnf8xpaaNZqRbsqfMe7dX9oXIr1qogb0yH5LSrQRgmVnnHk/csK0ibAHjClD5qTf+5pPevBDEMPsBRSgw6954VRMwl2fl28vRRXqCIrMklg3eSX8JMRGGPV7xhml2/eXAspO6IHy4XevkHdoKIM17/icXXMOf5KWcsC3FguMPjlTbWPTe53+Va1+G0ddFQDcu6XgpaUAhDCL5lKmGsyo9SfnsA8n5zvh/dIIay0Dwj2DsI5cgxXh5j3ebXRSQ8jlcbAnbppzp1YDQFCKZH3SokPoRfHATDk5nZB2stHCo3p9srXkrKToq7/cYB6Jenae7+dRE/KHU/EsCsgcuGFBNSmaa+0VTeGmHcrLio1BNjW+4UQXxMPzPxRKB82IiqTCPtI0IHKsO+bqLalMUVTl+XFR+e2aoHxHSYoR24VAoo2VZcg8QliDByADGwL4DHwTYNV8IqAwJ8WNyqY6N3uSw+/k83lifYVKaCj66Jdpni5eXe5DFnm141rwxJzNdo/XNu8xX55/LQIeqkk9CdsqnICunsc8c9JK2Rq0tztGBmHvF e/Q8dETI CHXN8xyVs9AjfY9Prf0xdWlGuD7A6/q49+qCsX3NkbETiWXVV7r10+5wtTKnVG7Z/ciY0czn94Tt0gTFPdV9HeqF5Yo+4FFNuYV6LLcDRoN/nFCkDnAX/AOuLWkvKzUYkveb8NVOccpiTXrMLT2c3PzK1aleq+rBsY78zkxZJPSy/mUjivO6p0Z5gk+YGq/dKVBzVJtMqSejCq84/7g1Yz50aEGwIOhTMYxDaFez423vOoapsmPOM4h2niqquZs0MvIyPJBeQikxOrhCucUaRH9rDANZ65licDbl6Wk7+ntD63ZncEfy/AgGd7MRYn0Pwo0fWWcNjE0wo4Ho= 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) --- 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;