Received: by 2002:a05:6a10:5594:0:0:0:0 with SMTP id ee20csp394148pxb; Mon, 25 Apr 2022 12:09:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZWbyC7ncWGuWWWcZ5SzmFYQKklnceB7edwDwY+/Xy2bSS0HfJNFcZ+gddXRM9fhTCyriU X-Received: by 2002:a17:902:ce0a:b0:15d:917:fad4 with SMTP id k10-20020a170902ce0a00b0015d0917fad4mr7930966plg.3.1650913745548; Mon, 25 Apr 2022 12:09:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650913745; cv=none; d=google.com; s=arc-20160816; b=A667Vng4QFeyhwaYAtHvDqnSJeMw7rHbCse7pVW7tXZ5x71+UrK/IzNmiwJKgXUMQ4 94srM2rL9yq6GKlbqviWH23HfO9QIuNAosXn007oRqsfdh3EoCTmSLDeRoE0Y7JyWcxI FHBWfGLwTKrLCyo6pElYqVF76Ek40kGu8WAHU0gIVrhJe9pbehpa1TmlyXRTvLUD6ShK 1QvHEaQxm83AFZbhakJH9M9SEHhjhNajWVQ/yLayHQRcet+QBPofWnS5KmT2dQf//dKK DRrFht5SPE/hyJkDIZnALppoQUXgsgR2NBVxvqpq/qlsP5SYV0vt5eHPWVadoDGNkcO7 Ejng== 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:reply-to :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=JX3ps6oeKyuY4MRNJ2GnR5dfK9tpHY2lYtVKJFK+Xqk=; b=glyIPG5XhWGqnVdN2e83rfXQmNCMxn1EegIQ2+Nmsn3TEoo40hWrHGFSkmGy551GTk ems4dj4aO/fxqudsGJ6RNaIf/noIgN2hMTmL0fqcesPuTw9eqNHrfVsf5UHogky3SOmt 5VfUO3/i93RBUiDXWAPo0wEJp2qUfdwuk9Hzhkmajz2WlcHftjmDzFrly6YfIzX4cNXC VunpMxu625t+14aQ55SrlI6KtkAqkgjyGlpoQYN9zipkAd01xcwI522JUTjmL7hAGj8q oH6Uu3KwxC3qZ2Z2YxjxLKwbkP1UYF2zO+F5q+06461A4eJmhRA9aqwm+9uMa7q5jbJF OMFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sent.com header.s=fm1 header.b=TDLUN33a; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=kPGxsDlj; 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=NONE dis=NONE) header.from=sent.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f3-20020a637543000000b003aafa0ed006si7946476pgn.105.2022.04.25.12.08.47; Mon, 25 Apr 2022 12:09:05 -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=@sent.com header.s=fm1 header.b=TDLUN33a; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=kPGxsDlj; 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=NONE dis=NONE) header.from=sent.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234199AbiDYOew (ORCPT + 99 others); Mon, 25 Apr 2022 10:34:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237306AbiDYOeg (ORCPT ); Mon, 25 Apr 2022 10:34:36 -0400 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B34556466 for ; Mon, 25 Apr 2022 07:31:32 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id DE5505C015E; Mon, 25 Apr 2022 10:31:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 25 Apr 2022 10:31:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sent.com; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:reply-to:sender:subject:subject:to:to; s=fm1; t= 1650897091; x=1650983491; bh=JX3ps6oeKyuY4MRNJ2GnR5dfK9tpHY2lYtV KJFK+Xqk=; b=TDLUN33aq/3MMOOBQQuus8Fk/UJeHWVmjSrGGfM1mfa8bAK7vJ5 wBgjeOJBfDbCb1I+PWErV8urwm1X8HsvklEN2dNwEBFu94cLiujXIAvbXoffx4gk l2kjZo7ki3kbSZyrX5cNTWKwN64199owIRtTiDNJgbbg8OHol/1LlxZuobIz0GVg InGz1TautCYF+GhvEtdFDS4AkX0OenV93TdDt+1GDmoLvymu8FlJ6s+1hBmj+Mkk SZar04DgOqU5FQqIekQsE4D+SpcP3Mg2/7TC2gu6nKcBytgL90mZ/VmMEprwPZ7U shukvJcGtjcIIeMfMU5hz29FVM+3qGS/iew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1650897091; x=1650983491; bh=J X3ps6oeKyuY4MRNJ2GnR5dfK9tpHY2lYtVKJFK+Xqk=; b=kPGxsDlj958gfs7of XLw5DbJmBrF786oXF8yS51MeyrHP/OkunAM2eAuyNQdZi0QGdoccKuDxO1XUYst8 yiFIaBmFTDJ7CWWYlvSwpqV9LLqzLRcXPmnXmFk5ZaBjX1kiCHnT/nE6xylRvB+j lT+TQJnJ3Y9RGorphVoO7+m056go8ZZopyTT2x7vMqUeNb5Z0C2yyRiep1NW0t1v VqqTDedauWXYj1AsuuOJNYVa2NZDx/MF2dpkqgz0/cdLt52NSLD2OPWd0sjE4xMX I0KJdFXQD/ThxZwdIYcZPbxwittjpaGNQi/XUJtLaQ68tM/UAUUvv/sZi1WwMNE5 a++TA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedruddugdejhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfrhggtgfgsehtqhertdertdejnecuhfhrohhmpegkihcu jggrnhcuoeiiihdrhigrnhesshgvnhhtrdgtohhmqeenucggtffrrghtthgvrhhnpeevhe evleehgfduhffhudefteehhfegjeeiudevheevffetuedttdfhkeeuleehudenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeiiihdrhigrnhessh gvnhhtrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 25 Apr 2022 10:31:31 -0400 (EDT) From: Zi Yan To: David Hildenbrand , linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Vlastimil Babka , Mel Gorman , Eric Ren , Mike Rapoport , Oscar Salvador , Christophe Leroy , Andrew Morton , Zi Yan Subject: [PATCH v11 5/6] mm: cma: use pageblock_order as the single alignment Date: Mon, 25 Apr 2022 10:31:17 -0400 Message-Id: <20220425143118.2850746-6-zi.yan@sent.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220425143118.2850746-1-zi.yan@sent.com> References: <20220425143118.2850746-1-zi.yan@sent.com> Reply-To: Zi Yan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,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 From: Zi Yan Now alloc_contig_range() works at pageblock granularity. Change CMA allocation, which uses alloc_contig_range(), to use pageblock_nr_pages alignment. Signed-off-by: Zi Yan --- include/linux/cma.h | 4 ++-- include/linux/mmzone.h | 5 +---- mm/page_alloc.c | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/include/linux/cma.h b/include/linux/cma.h index a6f637342740..63873b93deaa 100644 --- a/include/linux/cma.h +++ b/include/linux/cma.h @@ -17,11 +17,11 @@ #define CMA_MAX_NAME 64 =20 /* - * TODO: once the buddy -- especially pageblock merging and alloc_contig_r= ange() + * the buddy -- especially pageblock merging and alloc_contig_range() * -- can deal with only some pageblocks of a higher-order page being * MIGRATE_CMA, we can use pageblock_nr_pages. */ -#define CMA_MIN_ALIGNMENT_PAGES MAX_ORDER_NR_PAGES +#define CMA_MIN_ALIGNMENT_PAGES pageblock_nr_pages #define CMA_MIN_ALIGNMENT_BYTES (PAGE_SIZE * CMA_MIN_ALIGNMENT_PAGES) =20 struct cma; diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 46ffab808f03..aab70355d64f 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -54,10 +54,7 @@ enum migratetype { * * The way to use it is to change migratetype of a range of * pageblocks to MIGRATE_CMA which can be done by - * __free_pageblock_cma() function. What is important though - * is that a range of pageblocks must be aligned to - * MAX_ORDER_NR_PAGES should biggest page be bigger than - * a single pageblock. + * __free_pageblock_cma() function. */ MIGRATE_CMA, #endif diff --git a/mm/page_alloc.c b/mm/page_alloc.c index a002cf12eb6c..bc9e129ab3d1 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -9014,8 +9014,8 @@ int __alloc_contig_migrate_range(struct compact_contr= ol *cc, * be either of the two. * @gfp_mask: GFP mask to use during compaction * - * The PFN range does not have to be pageblock or MAX_ORDER_NR_PAGES - * aligned. The PFN range must belong to a single zone. + * The PFN range does not have to be pageblock aligned. The PFN range must + * belong to a single zone. * * The first thing this routine does is attempt to MIGRATE_ISOLATE all * pageblocks in the range. Once isolated, the pageblocks should not --=20 2.35.1