Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1621743rwi; Thu, 20 Oct 2022 15:10:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6sIcxdrQdOJp8X9R1P0ZU/xWKcnqYFsAzW6X9oHEUWk/fisnj4Kj7KRBEvvPMtsM5c+TfB X-Received: by 2002:a05:6a00:22d1:b0:562:5d7d:5588 with SMTP id f17-20020a056a0022d100b005625d7d5588mr16017211pfj.58.1666303828315; Thu, 20 Oct 2022 15:10:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666303828; cv=none; d=google.com; s=arc-20160816; b=YF3Ca0g8HGHNmfkMnpA2qVU9wkcayFjIG8StfL/IkJMsvyABd4vwnhph0H9yXDRT8/ tYTa90GpIcfErP75H7cDvG4SQh0+izI1mlaC1j2tUWj+7KPZjh/AGVyLg4/kqiCvSnXt MyLI0aFpcq16OoDhxA8XnK6BdldLZangLaLQv0nTGAnflMbtqZeO+tWgdemYldG0UZzA c9yJLXELuHzpqGruxiu7pW8Ue2eT/iovQ3Ebt3jAEE11j3Ev4PAIjh9L/LXajRrikfFO c1AikGSHZpaDgU0O8nRlI94o7Z0qDoeiOBPUGDospksuOtLnvCn8lttBprzKz+4Xl2T3 U/NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3QVy7NAfSopf+Iij2pw0HKI71t//u6xehpjVOpbyUMY=; b=g/zWTyRVLzSHPAo50y3s87xAZslJ0Rfm5aOV1/Ib0/iW76Ihpx2Y+mcvprjG8l/7im VJtSDGNKqXKGuFv62RkW9xWvZZC4n4Z0nyk6ZruWW5MM1wIHsJkQdF8TouWLEW+0sXJM ZflHcX1+vhlDM3E1Q10yK9cxPCZ0wep2NxwsK5yUrN0yWxgTnFVOXD7TF1kZ+eT0WBaQ nCWRIKLOmXORiXQjRPtA6RHjYh3ue0+Nw/sr3zTHx+kKttl6t0UX33/0Wk7eyz15TTJh CqQJlQD8n9llcBNCIRZisCPeOz0057keLbcCiczg4HaTjV8PpMvSbESkxTduas/DVtgM gMcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="J+iDN/3M"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mz2-20020a17090b378200b0020d43be11b1si3896133pjb.131.2022.10.20.15.10.16; Thu, 20 Oct 2022 15:10:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="J+iDN/3M"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229535AbiJTVzL (ORCPT + 99 others); Thu, 20 Oct 2022 17:55:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230116AbiJTVyw (ORCPT ); Thu, 20 Oct 2022 17:54:52 -0400 Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D30A501A6; Thu, 20 Oct 2022 14:54:33 -0700 (PDT) Received: by mail-qv1-xf31.google.com with SMTP id mx8so611407qvb.8; 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=ocMfqTiz6oX3NxL7xt0SKGqssbXi0f1nZlSmdC/NmNavzkIN52JNTz85Uc27gx03AT gvHTxMdVcrdS4myKzlan3dVMc6uuDFW2gO35SXk1q8IpV21QxSL68duwfmZ92WeOHXMo ZvcRQwLvEDd0AVIHJ1bUongy1qV7YH7RplZilLYv6bcOrw+sorNDfIPbaXor0L2fx37Y eKEI8fQTdEdAZU9QMwy9rwODhGlQs8z1h4NH1VS/dazseBuhQV2DfgapSbav3gW6RreW 5c1XzE1L1Id9rC+2p48sZPmUcfRSY1xWHetVJHYl+cNO7GzSMeKyJsF9VJQ4EXeJKDN0 1G4g== X-Gm-Message-State: ACrzQf05uB3vs+8tWhitFQj4qDFgmC0W/+7fbwhUD9t3Phdd2EKQeH1O qkbiD1txxL2Dekof2bdLTok= 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 */ -- 2.25.1