Message ID | 20220913195508.3511038-11-opendmb@gmail.com (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 1C475ECAAD8 for <linux-mm@archiver.kernel.org>; Tue, 13 Sep 2022 19:58:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A4CFA6B0088; Tue, 13 Sep 2022 15:58:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9FD1F6B0089; Tue, 13 Sep 2022 15:58:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 876BA8D0001; Tue, 13 Sep 2022 15:58:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 77D516B0088 for <linux-mm@kvack.org>; Tue, 13 Sep 2022 15:58:32 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 56C1A1C6486 for <linux-mm@kvack.org>; Tue, 13 Sep 2022 19:58:32 +0000 (UTC) X-FDA: 79908124464.30.B1D19F7 Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) by imf25.hostedemail.com (Postfix) with ESMTP id 0CC84A00BD for <linux-mm@kvack.org>; Tue, 13 Sep 2022 19:58:31 +0000 (UTC) Received: by mail-qt1-f169.google.com with SMTP id g12so9223173qts.1 for <linux-mm@kvack.org>; Tue, 13 Sep 2022 12:58:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=bjPZ9urefAsJcftBbAgQB1diXayOj809VCbylW0WU+4=; b=ElB8vGfwnTgMrOHPV8jOPMjX9e4dyOnpsA/daCy84nADITgBEDs0AWwUlYd7LmzJ4R Fd+wihlwr+eHGiOYJevIadmukrrhPQQQbV14He/EgVL8UId/ZjEQspu78E84lCBkqAk3 9AGpDbnJvnF63g83iAedqf+9zINjZ62a64qbSfO2T1vB7Ckgl7brAPRPzZAIUuLk9YsF YnnaDAUhOF2TFJBs1+hdGFIi2/6/xETSCDXaO1b95XuqZwbhceSd0bqWp4uVAOWzs4lk zAxkAToGZXGzD1zml0W1YllS9/kHr+k5y9Z8yZENt9c1+33raLf8akoDdgYfGMOxfC4A ITFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=bjPZ9urefAsJcftBbAgQB1diXayOj809VCbylW0WU+4=; b=gTa+SNwQQIvxnp43Q3haRpfAQYaej/Nz+l/Tpx8NkISU/Y8gF1eAgK2EdYK8HNu7rl IYDTjx5h0yudrmZCFIQ9x/tN2L41RznfmMCLLULm/xMM3ngy0IsnHhgW5oxbgKWnFPto eyPlhY02wkNxEe7HHafK1GsTeOQIItCbXhc7Awo3rwFrd5ELdHQ6elfpAi3IcO0WXlIY f7RYR+vVoLkzUz9922edHDPQg5GpgyC6mWZ7Q6gsNyL9BAoNj90EqWug2h4vFYyjp8Up OwMlQvbCLtP/Lq4u2WTNla06ZJzEkKz2MHhHYXGKZBs1g4lxfBLyY24Gh0nYwxCeBlP5 JrbA== X-Gm-Message-State: ACgBeo0rsj96ghpvvPmcvGBgdUKsPe2ZVfoPvpmzybxaLST1p+62DhvJ eoSPbUf/nWfOaUvq2oUsKAJAKbUN9pw= X-Google-Smtp-Source: AA6agR4w6aZMPi6cpzcCwIclFPfEwGVo8/KdfU9B4JBAlrDz19GDQ32yg1HkC6aVwcDa1gVOoM50cA== X-Received: by 2002:a05:622a:174b:b0:343:1fc:14d8 with SMTP id l11-20020a05622a174b00b0034301fc14d8mr29317121qtk.579.1663099111308; Tue, 13 Sep 2022 12:58:31 -0700 (PDT) Received: from stbirv-lnx-3.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id s11-20020a05620a29cb00b006b8e049cf08sm276305qkp.2.2022.09.13.12.58.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Sep 2022 12:58:30 -0700 (PDT) From: Doug Berger <opendmb@gmail.com> To: Andrew Morton <akpm@linux-foundation.org> Cc: Jonathan Corbet <corbet@lwn.net>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Frank Rowand <frowand.list@gmail.com>, Mike Kravetz <mike.kravetz@oracle.com>, Muchun Song <songmuchun@bytedance.com>, Mike Rapoport <rppt@kernel.org>, Christoph Hellwig <hch@lst.de>, Marek Szyprowski <m.szyprowski@samsung.com>, Robin Murphy <robin.murphy@arm.com>, Borislav Petkov <bp@suse.de>, "Paul E. McKenney" <paulmck@kernel.org>, Neeraj Upadhyay <quic_neeraju@quicinc.com>, Randy Dunlap <rdunlap@infradead.org>, Damien Le Moal <damien.lemoal@opensource.wdc.com>, Doug Berger <opendmb@gmail.com>, Florian Fainelli <f.fainelli@gmail.com>, David Hildenbrand <david@redhat.com>, Zi Yan <ziy@nvidia.com>, Oscar Salvador <osalvador@suse.de>, Hari Bathini <hbathini@linux.ibm.com>, Kees Cook <keescook@chromium.org>, - <devicetree-spec@vger.kernel.org>, KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>, Mel Gorman <mgorman@suse.de>, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux.dev Subject: [PATCH 10/21] mm/page_alloc.c: allow oversized movablecore Date: Tue, 13 Sep 2022 12:54:57 -0700 Message-Id: <20220913195508.3511038-11-opendmb@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220913195508.3511038-1-opendmb@gmail.com> References: <20220913195508.3511038-1-opendmb@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663099112; 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=bjPZ9urefAsJcftBbAgQB1diXayOj809VCbylW0WU+4=; b=fnKqKJGbdgp2Meten+bKOKiJJwJBCZ4tC2rc7LlflEBW958HqyG+m2n7IeSTrnGppY2R3x 9Wb+wAVnmmNzU08NsTMBw+tOYt/RLPA2oOAgyJYDiouqTapF3Xfq2h8tCTVK1V+vGHZ4NA SEY3Igep1jp0JZNcHdIIM7PrbQJyrvY= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ElB8vGfw; spf=pass (imf25.hostedemail.com: domain of opendmb@gmail.com designates 209.85.160.169 as permitted sender) smtp.mailfrom=opendmb@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663099112; a=rsa-sha256; cv=none; b=sad7pg+wO96fv2INbADjfIzQ5Q4UcBZpgTOzfpjDWgnvSmjRfU2RPzK0WKiHV9JremyYwh HeVR07a69gJuKKs8Rr1c+6a4RCexTI2Ig077DLOAC2ECNZChPakRAH0JH/lNJJp91gPeep A4Assyzbig3Ri8bvmYjOQ/8F68bJmsA= X-Rspam-User: X-Stat-Signature: rhuu7ub1e4m34qn68nzxdfotkdodszg4 X-Rspamd-Queue-Id: 0CC84A00BD Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ElB8vGfw; spf=pass (imf25.hostedemail.com: domain of opendmb@gmail.com designates 209.85.160.169 as permitted sender) smtp.mailfrom=opendmb@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam08 X-HE-Tag: 1663099111-590146 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> |
Series |
mm: introduce Designated Movable Blocks
|
expand
|
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index b6074961fb59..ad38a81203e5 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -8041,13 +8041,13 @@ static void __init find_zone_movable_pfns_for_nodes(void) corepages = totalpages - required_movablecore; required_kernelcore = max(required_kernelcore, corepages); + } else if (!required_kernelcore) { + /* If kernelcore was not specified, there is no ZONE_MOVABLE */ + goto out; } - /* - * If kernelcore was not specified or kernelcore size is larger - * than totalpages, there is no ZONE_MOVABLE. - */ - if (!required_kernelcore || required_kernelcore >= totalpages) + /* If kernelcore size exceeds totalpages, there is no ZONE_MOVABLE */ + if (required_kernelcore >= totalpages) goto out; /* usable_startpfn is the lowest possible pfn ZONE_MOVABLE can be at */
Now that the error in computation of corepages has been corrected by commit 9fd745d450e7 ("mm: fix overflow in find_zone_movable_pfns_for_nodes()"), oversized specifications of movablecore will result in a zero value for required_kernelcore if it is not also specified. It is unintuitive for such a request to lead to no ZONE_MOVABLE memory when the kernel parameters are clearly requesting some. The current behavior when requesting an oversized kernelcore is to classify all of the pages in movable_zone as kernelcore. The new behavior when requesting an oversized movablecore (when not also specifying kernelcore) is to similarly classify all of the pages in movable_zone as movablecore. Signed-off-by: Doug Berger <opendmb@gmail.com> --- mm/page_alloc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)