Message ID | 20240801060826.559858-14-rppt@kernel.org (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 0C2CFC3DA4A for <linux-mm@archiver.kernel.org>; Thu, 1 Aug 2024 06:11:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8FA206B00AA; Thu, 1 Aug 2024 02:11:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8598B6B00AC; Thu, 1 Aug 2024 02:11:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 637E76B00AD; Thu, 1 Aug 2024 02:11:22 -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 393786B00AA for <linux-mm@kvack.org>; Thu, 1 Aug 2024 02:11:22 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id E9100A08CD for <linux-mm@kvack.org>; Thu, 1 Aug 2024 06:11:21 +0000 (UTC) X-FDA: 82402654362.09.3B4AC26 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf16.hostedemail.com (Postfix) with ESMTP id 468D8180018 for <linux-mm@kvack.org>; Thu, 1 Aug 2024 06:11:20 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=QI4Ewjqh; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf16.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722492634; a=rsa-sha256; cv=none; b=lCoWnbGzKS+1NFsUVG8Ze9jQqmjCVlWbnwBkx568X+MPFtqEb83myAsgX9X1/eB+5ntwSp inmUIQ833D1XKO8/SI0N3mIgnoLcBBIF1iWlrobYZ7K+O4T7fi+dyzRfIJqas6oVSwcnzq Gfc1Q4E1wATbePetOTs0gR00cPlvsDA= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=QI4Ewjqh; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf16.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 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=1722492634; 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=nmzOpg0JTx1pCcKSTmmbgph0fZ/wgtHghU2Q/iaXZP4=; b=D+QVwt1fcHc5wk4BzkGL0Mcm5uKSwyPVfes+Ty66DSddR1mY9UUzy846Hvu7Jv3VNvaYNg 30Q5Wtk8YPeP08Qwu6NcMxGOnE1WN0tfqzMsKU7BRJnKL8eTRbuUXkkljAFH8nq/DRHgfU gMyvpawBOcc+puRhoKd1EjgFbXE9MA0= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 620B162770; Thu, 1 Aug 2024 06:11:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE12DC4AF0A; Thu, 1 Aug 2024 06:11:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722492679; bh=UKbRiZvva5pXaCAN24L+st+TlDsrE6ScVNjHbfzaMRQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QI4EwjqhxFK7jXHI8z7S0O57azEU4hGOVevIE/YotTQq1td3MZ2supNz+Ar1UY/8p CqH0vm+HUdWwyyQtOmTJL8GxeHWgkoxA9rHrAqFDpO8QZvDQ0B7A/qtQd6XIYMmvCL yF+WVGjYTgkr8pTlPUXdfLQPO4+BiiuOVGnFri2SIJQj7s3JUdSLac9RwDt0im45/z KF+xkSA/StepsYoUsUx9dms3l08hn82DVtcw4Ebjuu7NI0IYntmyRLFRWCUSLJV2AM w6aVlRwary2DoahCBShwjZmokC0xXVajZA+CqgVwGuwUANLNZrZgdNx4T+e3NLqx7w MkJo6xLcQkn0w== From: Mike Rapoport <rppt@kernel.org> To: linux-kernel@vger.kernel.org Cc: Alexander Gordeev <agordeev@linux.ibm.com>, Andreas Larsson <andreas@gaisler.com>, Andrew Morton <akpm@linux-foundation.org>, Arnd Bergmann <arnd@arndb.de>, Borislav Petkov <bp@alien8.de>, Catalin Marinas <catalin.marinas@arm.com>, Christophe Leroy <christophe.leroy@csgroup.eu>, Dan Williams <dan.j.williams@intel.com>, Dave Hansen <dave.hansen@linux.intel.com>, David Hildenbrand <david@redhat.com>, "David S. Miller" <davem@davemloft.net>, Davidlohr Bueso <dave@stgolabs.net>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Heiko Carstens <hca@linux.ibm.com>, Huacai Chen <chenhuacai@kernel.org>, Ingo Molnar <mingo@redhat.com>, Jiaxun Yang <jiaxun.yang@flygoat.com>, John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>, Jonathan Cameron <jonathan.cameron@huawei.com>, Jonathan Corbet <corbet@lwn.net>, Michael Ellerman <mpe@ellerman.id.au>, Mike Rapoport <rppt@kernel.org>, Palmer Dabbelt <palmer@dabbelt.com>, "Rafael J. Wysocki" <rafael@kernel.org>, Rob Herring <robh@kernel.org>, Samuel Holland <samuel.holland@sifive.com>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>, Thomas Gleixner <tglx@linutronix.de>, Vasily Gorbik <gor@linux.ibm.com>, Will Deacon <will@kernel.org>, Zi Yan <ziy@nvidia.com>, 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, Jonathan Cameron <Jonathan.Cameron@huawei.com> Subject: [PATCH v3 13/26] x86/numa_emu: simplify allocation of phys_dist Date: Thu, 1 Aug 2024 09:08:13 +0300 Message-ID: <20240801060826.559858-14-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 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 468D8180018 X-Stat-Signature: 61wocwg33jispo1sux9nyei36uf94qts X-Rspam-User: X-HE-Tag: 1722492680-41885 X-HE-Meta: U2FsdGVkX1/jBRnlJXAGS8p1FlJjoukWFepYV+b7ORogfdt7FblZjQkWIuRRm4/7r7jjUcBtk8Ne0YV4kW/mvmuoWLLXxEvRHI2QEUtbdGIFRW3XC64v82naSQxpRnq2+Z4SrgiB84TBm1sjS0UIJfmRyjXTbf8gThET/dzs13h+aXVv0p/iLaXy7em5eObG6Lv5vvVv/M0wzBAnnmAlFKvgTQYiupu9V69/mWlON3kJhabClaSSkLGj13pwuVAAbRqLSLhJq1t4jD0fx4OdqKqaOWGc/JQ9FjOk+WJmAFoaiJWLrge+5DeE9oX4/QJEDke9Zx831LN7JXnvoW6t0ZfJr4lJA5ZE9nYWL5qCwD70k/CFI7iRfhiPVbZXzTSOxrPZ811LKy3fv6FB8wlTu9ANLgeC5TtS0uR86Jd7hlSizOKN8QblhtjFsB+fq+cE1PNnz6pBLYgWVvTCDBBGXYjS+FdZZ7OUXCXDdPX8zifroLKPXrVbglSIPy6TSk3UvH7IOI8f9CGQOjfV1r8WJXjA3C8JfJUavz7cN5+Aei7f468kkjwKHhHSoL31vWL8RNvtGPH73xaU/k1UR1TQv8QjfaGD868cWZMiXnt5bvIx5prVWjWrJGtjHH79G0RN00o8/46OZ44TsFqCAFutlQUEsvScfdVL2V3JRn4zC9shv9ggQyvfsKBjwaaBrzT2hPuJM5Tx3BCf2PFDHbnUUK0jFQZE5cP8m+Y4draulekCsbIHljOLLdHU8OOmVhUO9EPY32b5QP1roAh0PuEfAY4FMf+Fqi0J0wiEl2Ohp2h8THWdwib5GHkZ/8z8PwsfWnJtlVrWOQeWuBJ6yV2bcKgy+38UGzf0u+T0fiAxslrrhxigXO2Thnxr82oAzv29bAglHUMwrKJvjTCEqgRbkV9O6ReZCKrQTBVjRLmsCegdffr33/OXwhctgDS++jRI4ytQ4F6wcjA8I2IfLBB DDCW6u+4 +dT3QSzLu5lBUfFpWuUHz9YQnOW3yl/fXwkx3CyIh1zBSeglVusK+GR8khwNanKaQnm0sTTZY9bQS1cecG7Y7Ihr6GtjVyccLuD1R7zIPqs9+p3xFnf9zfn6x0nJffPKkRoUfFNXW88j5ltiD740LyfzuUeGsw31XPvUSna5ophJE/nzoxPK4+Z540l9qDxFpauDWPene9jIyoSEOG5KpwbkR2Xs/X3v8dzOCJOCbamYU1d8OuFZZrNIN4EYOYsJGdOwq5BzmAkwh1NIpu3PP5oggt19/LqKc4nZDrIZvBALI3HZn7CkKgvVjrMf47dm/eMqw1cZCikPtxLM2xZSi/in42tFrrqrvYL5RYwomzlNpiJb4Ail9Bws77A== 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm: introduce numa_memblks
|
expand
|
On 01.08.24 08:08, Mike Rapoport wrote: > From: "Mike Rapoport (Microsoft)" <rppt@kernel.org> > > By the time numa_emulation() is called, all physical memory is already > mapped in the direct map and there is no need to define limits for > memblock allocation. > > Replace memblock_phys_alloc_range() with memblock_alloc(). > > Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org> > Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> > Tested-by: Zi Yan <ziy@nvidia.com> # for x86_64 and arm64 > --- Acked-by: David Hildenbrand <david@redhat.com>
diff --git a/arch/x86/mm/numa_emulation.c b/arch/x86/mm/numa_emulation.c index 1ce22e315b80..439804e21962 100644 --- a/arch/x86/mm/numa_emulation.c +++ b/arch/x86/mm/numa_emulation.c @@ -448,15 +448,11 @@ void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt) /* copy the physical distance table */ if (numa_dist_cnt) { - u64 phys; - - phys = memblock_phys_alloc_range(phys_size, PAGE_SIZE, 0, - PFN_PHYS(max_pfn_mapped)); - if (!phys) { + phys_dist = memblock_alloc(phys_size, PAGE_SIZE); + if (!phys_dist) { pr_warn("NUMA: Warning: can't allocate copy of distance table, disabling emulation\n"); goto no_emu; } - phys_dist = __va(phys); for (i = 0; i < numa_dist_cnt; i++) for (j = 0; j < numa_dist_cnt; j++)