From patchwork Thu Oct 20 21:53:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Berger X-Patchwork-Id: 13014051 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 B63FCC4332F for ; Thu, 20 Oct 2022 21:54:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5B2138E0008; Thu, 20 Oct 2022 17:54:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 562C18E0001; Thu, 20 Oct 2022 17:54:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 403768E0008; Thu, 20 Oct 2022 17:54:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 3383F8E0001 for ; Thu, 20 Oct 2022 17:54:34 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id D684581143 for ; Thu, 20 Oct 2022 21:54:33 +0000 (UTC) X-FDA: 80042682426.30.2068675 Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) by imf14.hostedemail.com (Postfix) with ESMTP id 8B6D0100023 for ; Thu, 20 Oct 2022 21:54:33 +0000 (UTC) Received: by mail-qv1-f52.google.com with SMTP id i12so637537qvs.2 for ; Thu, 20 Oct 2022 14:54:33 -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 :message-id:reply-to; bh=3QVy7NAfSopf+Iij2pw0HKI71t//u6xehpjVOpbyUMY=; b=J+iDN/3M1v4SmMv54h7rTzpz0LCv5/XHzg8ewdpWRJK70RuAF16mbixTaMb/vBat51 /mOQLg5Lg+eWwblMvbeXIjCw6c7NGBNFeD/y4PUno/X8AVsvp3cN9kuMppVqjdsN5kl6 orFfq4ybTrc/U75TOFffbD2FHq/yB8TQdUCF4W5zgxsL4RtZssN3wgMFfKwcAq4UKdf8 F8nDYyOYiinRzsKsyxRooF/HEUiIjI0N0PbTdoyDCvkE5xiCtErgJjWuKYBHcuAzQd0V 2rntUIgntvNQWYugXRMQ7XaB2yU5azO8RSIVC6neC4mThi5qsxjgKAfWCPpzvk9W2R02 HrBw== 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:message-id:reply-to; bh=3QVy7NAfSopf+Iij2pw0HKI71t//u6xehpjVOpbyUMY=; b=dC9x6RmcFUwl+1Uy3yHqEwynatsZ2/zYIdA3eBu8BqU4xImGtmqTeOFhNPvLkeD1uf MCOvxrCQ8GTVIsFSS1DtvuxoZ+lqlhcEuB9DvBpLDUUCsctYNABkbeN8ky2CCsb50yg1 B6Y8NILfXrovtnRmFvBG3blhse4Y91os17x2plOjBYe4N4+2xhHLZ04QXpNvpYfYABfG zCLKcDGRGC4wIrPjz2NuGKwLfFXwdV1CnNhI50PQpeoqwtUphFMd4043obGhVF9mGuvX Hha0t2YKYcftfL6ZHSGzhxl6dJ8/5ApCve3vjQ8HXJfH57uvvwxmz9e3ZUMPpv0jmSmx 0hhw== X-Gm-Message-State: ACrzQf3PQ91GIb1kWuTZgCEwIffFiGNDvXg3mfXFUQ5VxwBZmWqlUNt0 99olLGjuPLUOite0dB1CjXI= X-Google-Smtp-Source: AMsMyM5aXseEnbCth+1erHFOC0l1o/oiEp9CjvS4tO2sP+AMndswz+RDyF7PQHIu1wmG8A/x1Oi+0g== X-Received: by 2002:ad4:5949:0:b0:4b4:8535:97a4 with SMTP id eo9-20020ad45949000000b004b4853597a4mr13776300qvb.101.1666302872827; Thu, 20 Oct 2022 14:54:32 -0700 (PDT) Received: from stbirv-lnx-3.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id bj41-20020a05620a192900b006bb29d932e1sm8121067qkb.105.2022.10.20.14.54.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 14:54:32 -0700 (PDT) From: Doug Berger To: Andrew Morton Cc: Jonathan Corbet , Mike Rapoport , Borislav Petkov , "Paul E. McKenney" , Neeraj Upadhyay , Randy Dunlap , Damien Le Moal , Muchun Song , Vlastimil Babka , Johannes Weiner , Michal Hocko , KOSAKI Motohiro , Mel Gorman , Mike Kravetz , Florian Fainelli , David Hildenbrand , Oscar Salvador , Joonsoo Kim , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Doug Berger Subject: [PATCH v3 4/9] mm/page_alloc.c: allow oversized movablecore Date: Thu, 20 Oct 2022 14:53:13 -0700 Message-Id: <20221020215318.4193269-5-opendmb@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221020215318.4193269-1-opendmb@gmail.com> References: <20221020215318.4193269-1-opendmb@gmail.com> MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666302873; a=rsa-sha256; cv=none; b=cSS3SHNqQk2Fnboq7GQNPSxVJNlbtMqVAvjsg74lOqMQHUe4j1Z15RMOu+TfG0OVWe/ILP GlTknU4pJIArbAwSzhlBtkybMuL6dd/SV/DQ6DJfFeODbDn4nxb9CuSdFt+fWybyQYZvEH +BpI7Hpg1zqFSfhLAFKaSJjARAbUZgM= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="J+iDN/3M"; spf=pass (imf14.hostedemail.com: domain of opendmb@gmail.com designates 209.85.219.52 as permitted sender) smtp.mailfrom=opendmb@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666302873; 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=3QVy7NAfSopf+Iij2pw0HKI71t//u6xehpjVOpbyUMY=; b=46s1vNgp1GzENJvQ0wOFFObEkI2ffY76M01hqlqKzcgUIOSA90ruaZtNyIemUxOUAcETRv aLqI26nXdRBMXZTYegf/zc7uhs1mOyDXe1KJeheHC6tc+N5wqxtI1JfG7tc2jMU/8cILh+ a9+MI+W+CfxAeDt2lowZuyds1WfP+fw= X-Stat-Signature: owp91k11bsdgxux8qa4n85aocmjtdqga X-Rspamd-Queue-Id: 8B6D0100023 X-Rspam-User: X-Rspamd-Server: rspam03 Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="J+iDN/3M"; spf=pass (imf14.hostedemail.com: domain of opendmb@gmail.com designates 209.85.219.52 as permitted sender) smtp.mailfrom=opendmb@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1666302873-473101 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: 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 --- mm/page_alloc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2f7b88d78bc2..a4c2c157bacf 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -8121,13 +8121,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 */