From patchwork Thu Aug 1 06:08:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13749755 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 875E2C3DA64 for ; Thu, 1 Aug 2024 06:13:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 21AC06B0095; Thu, 1 Aug 2024 02:13:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A4666B00BD; Thu, 1 Aug 2024 02:13:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 01E856B00BE; Thu, 1 Aug 2024 02:13:10 -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 D66306B0095 for ; Thu, 1 Aug 2024 02:13:10 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 93ED2A6301 for ; Thu, 1 Aug 2024 06:13:10 +0000 (UTC) X-FDA: 82402658940.18.33CC42A Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf24.hostedemail.com (Postfix) with ESMTP id 5A48618000C for ; Thu, 1 Aug 2024 06:13:07 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Laf97Z1e; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf24.hostedemail.com: domain of rppt@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722492743; a=rsa-sha256; cv=none; b=bxxMQy0gUYFVa5YfYoHV6VQoL4+pV2KyQ42SWEi/neBhWhH9pTcrlh4Yhp7Wx8SX4UXWLR eZmnZegyR4szz6KEdEz1e0NQ/K3mtYshv7Q5cRKTVttWLqcbzhXEiJFFixZv9bYZkj8QXK wl8arqX79/KA+IGkQ6Bi+DSq/ljDvSw= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Laf97Z1e; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf24.hostedemail.com: domain of rppt@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722492743; 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=zt29HZs++2acMgTN2nsFuMGC1lkrkHmW15IBWfbwFGQ=; b=Q9winugdlCn4tiyL9F4JAwyhqoW3E0KT9xllaB9Cow4Zi7usecXKQ32poo22/AFeraASiq CoEreWN2MH23KE51Q2wGaAlCEvhll+0BQ7i/GloJs2XJagxMWr1ZSqyAPrv1pCftk/JVFi Z0NPwa4QZMF7NwfY7IiWqxtwCCUd08c= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 11EBBCE1805; Thu, 1 Aug 2024 06:13:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22222C4AF09; Thu, 1 Aug 2024 06:12:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722492784; bh=u0DwIdv5Q0LC3i7GMDCjqhk6wXf4CoZ6Rdfjx53JnRw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Laf97Z1e4hcu9PBv68jQasZmlcl44jxPkm5qsqBEaVcHPy1G/5p4hKyAOv+GaZ0cR YzGEBoSsm6ig7pKVD9TjO3YNDG12FuhrWOfM1+LkJPNNGqnc92putV4qJJm07pe0Jk LkllUlfZzz+53zk09otVS6H6hBwgc1BL4Qyegx5TvwtRxCPrtBIksSg00eK9Vzkhyc Ink899LpOi3D7p4U/+xT33YUBQNQq7ixjxSEIEeqox4fLTYDyVmqpNc/IT8slRHXis DjPDz1cL0BiU3e2k2Vtc4UuiwWZ3fpIzM/UbIqLOnh+wePPY4zbYTedpRY4xDGv1r4 +GfsBnftVLYvQ== 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 22/26] mm: numa_memblks: use memblock_{start,end}_of_DRAM() when sanitizing meminfo Date: Thu, 1 Aug 2024 09:08:22 +0300 Message-ID: <20240801060826.559858-23-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-Server: rspam12 X-Rspamd-Queue-Id: 5A48618000C X-Stat-Signature: sb6oreueb1umrawqcmeg7dtmh6ne16k8 X-Rspam-User: X-HE-Tag: 1722492787-832639 X-HE-Meta: U2FsdGVkX1/esa4+AKedjSpoKjeuqqIzg51UONavvH4dP+iK7i6XHla3TKwEjfIG74tR+S3A+JxY/4+HDhAN7CBKnE5lccDJ0lrngFLddXVL3X5utWwHvGJtS/D5GH+fGkoSScU6f3CLm89mHb9gvP6IVwoQb8ZYiDEJEXJu8NS9P8GLina+D7c3xSOR+Q+gok3CvTq0rWlDdY36vgLnqF9z25QeMKWjG7JAJSW2qE5TvrdCYHIC7c1qZGd7DA1ExdBqiVCOjo4q00BLEameI4hBl5Y0XrfEUZdu6TvALa612VSGu58cGC41HbGY8KIE6dNY3/z8EsMahyh5pMzyL9S8SBZ4umwds6JdhP6oZ4WVEMpeP7BRyKwbtSutEAwjN/1NkwTX4ZkvwKT7EbIi9qjSaFJRh+OpctaTyBlZKKdWqLpJc9TkKcQt1vT+mD9jY48tYctv70nIZffqBhahIdCfPs8UXtBN3CdfzsPsxykUuzgqwNaKWteT8W12KwKj/hcQboVZZgl5G7XsWLaauee5slfjAml5eYHkxGQcSga9lEQqx8x8jJvK7HtxIvEcQ42ZtPXajLg93f2u4xfB9aN9WgAy/e0b338KGGP2S64d3qP+xk2NB7m0YK8/AIVtujwM7HKI75fw/oe19jAt8PjCgZmhpPOy/SnwvvcjH+HKlKaKKj9zNcdCYYVQT+fl23MaYcWAmW0LuOr9bS61lV8UdQSeazzGMy+uPgV/A+a/0pkjNuJdHLezDsLUCnomkFl4RVNFcIJFn1K24j+gxE4N7x7F025yE6IHpvH9fbr6duZawqXSADQjSVLojcg2MNDmxMyZE4fw7SBkDgkWtbd4oVVDalLf7sg87vnQufi4Dt2/fGLI9Zq8P1q9YWG726iyAbj2nKbaPvp0D4e1sUrAXXk3dvMLVzwrztoq+qI23osQ0ClJLDhJzIFfQJigqRNzR5Yn9EolI/PD0cc Gaul3snb j+q6MLS6UpgyOrcCsfnU3eNqtOQJk4kFka6RszTVm6M6fJh0i7LbbGC4lr/zxEpl6hPWyb3kdCLI5/gRqz2iuLtEMYmOAFN5gE+DvLoHJeMYpaweT3jL4+FZt7yCCZQmOdfagcHhUFoH56Np9VGu1WbtyFdTaPqGKTZqAntQ8E7w1pespfQQg0qtUwfsjnegy4frvbnY1HEMv++2r9XIFjhvMXb3dlzCJkfLbjOqq2rE0/eCUnyWwC+yGqmsxRMV2l8zsgalhYm2kNJiicQk9Yb+/M12EF+am1eYw/Zui3f3ntADAUBg62pTjuqzupOq4K7wdwKWMD9oD1m2/l2AhewLfjZJO25Hxq0Ly 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) Tested-by: Zi Yan # for x86_64 and arm64 Reviewed-by: Jonathan Cameron Acked-by: David Hildenbrand --- 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 */