From patchwork Tue Jul 23 06:41:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13739450 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 F16FEC3DA63 for ; Tue, 23 Jul 2024 06:46:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 80A736B00BB; Tue, 23 Jul 2024 02:46:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 791E36B00BC; Tue, 23 Jul 2024 02:46:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 60C0B6B00BD; Tue, 23 Jul 2024 02:46:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 40EEA6B00BB for ; Tue, 23 Jul 2024 02:46:39 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 06F901C3AD4 for ; Tue, 23 Jul 2024 06:46:39 +0000 (UTC) X-FDA: 82370084118.05.49FDA5C Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf14.hostedemail.com (Postfix) with ESMTP id 0912C100009 for ; Tue, 23 Jul 2024 06:46:36 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=GdtNpb5f; spf=pass (imf14.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=1721717174; 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=IquVUnaSssq0FhtsngEdD0WtFGUdOiO21fxX0Knf6UU=; b=aFZQE7UKMf4T98EWTNWCInniUyuc048xbxravacdxL0P1HOgqYIR3ZefzmsBSrr8BEvRQZ iSRgumowwXkq1SYcwi233aRtK5xKRL9zvyLUwIF2HzW2lnkI3ldn8O2XvgLx5wxuNG8sdX AR5ETon6stab77T5q+JG1OSTJnLuBtk= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=GdtNpb5f; spf=pass (imf14.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=1721717174; a=rsa-sha256; cv=none; b=37RA0hyf+BvBDjOGihBJYcsSQEtQ8qNt3mbhG5vMtHIaZWuDJnNcHUl340oP3eM6nlco4N 57VzQplYI5ETB/MqssqxcjvH9lb2RUaWPgQFeZ1UyIWv2lfXtMBGszYF7Mgqy877nZvCOs EcyRj3pFPkmjDerPJL/FxMTym3c1ho8= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 5B0A6CE0E07; Tue, 23 Jul 2024 06:46:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E983C4AF14; Tue, 23 Jul 2024 06:46:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721717193; bh=zVDs6WKjT/YvUD2GuaqovEFQsz1PVdi+2wlgjwoVKBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GdtNpb5fUIpXsX9U29NSh04YZWODgndxZxjste8kTAvvVKauwF6UNM6S9Dr3BCKEs yzF3a95E4FDYjaodsPNzYMUIiAFluD4W6BzfRkWMXJaN5mJiDqA0nbhJUlVN8YBreY N8Lfe55rcuYatNFvDLpb1o/ai1cq2a87KFY1vXc2G3PokM+pzDBZiGx1YYc0JvUIwd hD+FxT+d7coc5Nv4te6g48WPgLLOAIBVm7uSHK4G4+cw6nfe/xZpmv2v/wDAZjLxfx maJJGo9Hlb/cksHiz+XhQBIYl3hu/DniwedBxjLUcBhi+OlRUy+RXddlr9a1o66hWz zfdJosOcK+iJA== 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 22/25] mm: numa_memblks: use memblock_{start,end}_of_DRAM() when sanitizing meminfo Date: Tue, 23 Jul 2024 09:41:53 +0300 Message-ID: <20240723064156.4009477-23-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-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 0912C100009 X-Stat-Signature: z8d47ibezfb9u8sh1xqm537ut1938qkc X-HE-Tag: 1721717196-77061 X-HE-Meta: U2FsdGVkX1+iSZOm1cmfdXkBlRzQN4Q1tjIph4qRPxoyLc4PcT1b8PomPkZSSswQDzKct6iqQqTqvnc5bI6ws6UKHA8DXUKYf2x3T/mnVl22BMTaBo/wjWVER6PMvny+BHSMNrhnbOSEwc5ZdElXBrc3rnRadyDdW8XEluirs18n5yCVSDdQpLdhiLg5SsZO9da2BHD29nwpJi8Ynp7ZnXjWXAvPAY1wCiAowd+Sb1nF+4T4Lm0oM38b80jfJTBti8BWV4LIaq9hHtjQhKLVTnxVK1ptMh2IpCWPFJVgdUoy8hGA79paHc+/rvDnQEcB83TUkNaUrXr1fsC5Ciuwd2rvIBE0+BGO/opoyQl4nnQsglP3VhhrTUs8cn1025LktZ7II6d2K7KiCQafx+zAYayyVDE0bVGlqQL1XYYhV3RvzOs4abSIDrjjOSf5EIY+lzB52UUWW4AP+wbfAb/M1I7tggzU14/uVVJUT+ANPZoYQZXQl99Ll1cIpQRyK+0IjJflquOTdzOyg0+dbl8onDDCfC/xpe4eBlq6ANvFH5o7eacTGoJNRbWImWQPncwzt10drR+o9TaV10Ysb/MNf7iCm2NekkJnvPVbqoUzWOnapr4roFhOoEFPF2JR7Xb/QgPgkzTUXvsspL6DjDntSwdahN3iWlC/6v6PoTuDxohbcyrmvRbl0NAvGLwsHutn52OeOQ6xyp8b8P7R/oTbMZytyY2bJCmmVT0sMYJQBfMXoxkKRQJBytS+gCGtmD6bEq//FGPOT6ob8Ym3xTS1voVG+HYPXSJ6Awdh7935NRxZe8oYHA5MDQfIZU00QMvHcnDNdcSK1UX+ilGUFJbn7V3NW5WK1McKcrGgOQiQuZNyXh7ZIfC38WmbVc9akvetSolyCXl8ScKEDq5m1F/kxl+4iJdCIroRcOIiHz8KcrE9bhnpZB0rlFz0smMeodU1690yDoYr5O7hQdomM6p UVEwSXqo xP6S6FdFg0EI3cd3SXgRICaBV9B82e+CEPdeNRr55KM7PcY1LMWMKRDFPmtby3PTabt+EvjgDruhkZ8Dy9p8eIolOvvA1aigCskYmVSCyV25I46WTbJHYi6MwuCZ/Vub2DCRs9Efpj5d6xtlNinmpunhMLzPSe+RUabZiBtbnZk+IHzN1QFvgNq9trzNxPl1PwtKctzqdhzz/vjV16mnEkr0QyU924WfyS4AThC00hMHgwBsjwkt1KhAoe6mjcdNusRzaI9JZfd9TlflJV+LOULvhzppASTbPmtQiI5I5NDo/R/+C6eITCcpo0BPbn3b6m8NB 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)" numa_cleanup_meminfo() moves blocks outside system RAM to numa_reserved_meminfo and it uses 0 and PFN_PHYS(max_pfn) to determine the memory boundaries. Replace the memory range boundaries with more portable memblock_start_of_DRAM() and memblock_end_of_DRAM(). Signed-off-by: Mike Rapoport (Microsoft) --- mm/numa_memblks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/numa_memblks.c b/mm/numa_memblks.c index e97665a5e8ce..e4358ad92233 100644 --- a/mm/numa_memblks.c +++ b/mm/numa_memblks.c @@ -212,8 +212,8 @@ int __init numa_add_memblk(int nid, u64 start, u64 end) */ int __init numa_cleanup_meminfo(struct numa_meminfo *mi) { - const u64 low = 0; - const u64 high = PFN_PHYS(max_pfn); + const u64 low = memblock_start_of_DRAM(); + const u64 high = memblock_end_of_DRAM(); int i, j, k; /* first, trim all entries */