Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1168338pxb; Wed, 6 Apr 2022 10:19:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc6M5bGvbAm8T5iV3gG6Y41JWB0rZJ9R8P5exnJFosQTU0TeHtc7Bbh68Fv0MK+GyYfv+5 X-Received: by 2002:a17:90a:5296:b0:1ca:78cc:7172 with SMTP id w22-20020a17090a529600b001ca78cc7172mr11266569pjh.99.1649265583039; Wed, 06 Apr 2022 10:19:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649265583; cv=none; d=google.com; s=arc-20160816; b=0AMLNt6rn7CenmpDD7oCjXf/0fy96AU/M78iQAc3siTgLU4+8De7H31kjvv2hXMOE3 ivgbLn6zQcEJofQ2l3E8EZ+LBfUH5Z5fXfvLO6hOqHWM/eynlBHbvmDugPjepF08pjQg SHnzoqrSadeAruOjcPsv+CvuuSjX+bayWN2JbnZPPN8+vXLQzE1+6MU+xVw/171gLsV5 dboA2wvbFQhVOAajXmwLiRGqObHCwS6c0TJtNNEYdra5VVDWI8B1riNXk7fhJOOC5tBa IoCGn9c+2HthS6sMk1yp92QcvxNixYMs4YdptpAm5n+o6mTnlyRkD7TCZjakwtvl9l5G 6byQ== 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=GCOCdLBvER1uJBwqDC45zH4ip40h8EDSqkmzj6WuqzU=; b=VQao9i9l58WTIxxtSgN87X0cIT+uwWjMlcw9oo/zHtXaKqLit3vP6rVzepmXEsyXFs qpFQA0qOj5SxlhbECvJxd0Q8PehUC5/KPnLTy1q+ujwiompaqBVGuNZLSUZapFSghxTy KwF1EjH5EB45V7v02ZcwQyWPE32O01Y1ScWjTvM4Aag+C3C1+u73TFi2RdyqUqqHWpau +pLJaISvddLvskZPDxH3nxCXPge8Sxs25cY9eXExI+jUe1OdJvmt65ZhLEv+l+MVtZWY O/NDzLrGsUuMNi6HX4hw7jFW2lLZd7+sC8BYVOt2oaTp4egPalnxzYOX7G/awbWveriR njdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sent.com header.s=fm3 header.b=zPfsw7WV; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=OMSf9dZu; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w25-20020a634759000000b003986443b1f0si16111696pgk.832.2022.04.06.10.19.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 10:19:43 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@sent.com header.s=fm3 header.b=zPfsw7WV; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=OMSf9dZu; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sent.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 955B218004E; Wed, 6 Apr 2022 10:19:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238899AbiDFRVb (ORCPT + 99 others); Wed, 6 Apr 2022 13:21:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238828AbiDFRVJ (ORCPT ); Wed, 6 Apr 2022 13:21:09 -0400 Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 173FC4A481A for ; Wed, 6 Apr 2022 08:19:46 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id D8F643201FB7; Wed, 6 Apr 2022 11:19:44 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 06 Apr 2022 11:19:45 -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=fm3; bh=GCOCd LBvER1uJBwqDC45zH4ip40h8EDSqkmzj6WuqzU=; b=zPfsw7WVg7lfi3ByClDpx 0pg9uXOgZUC08+l+yyQFqE/eWFZSlTarVl1MDvLMXRaa/2/ZjcdDop5ig6LPxi2i j4kYOFR+TfFnmhQjpjSW6gsIDoqKEK0PWamdmqO+JnFlJmkgHejLe0IiZyGxWjQD 9WWj7qlEhpZgWgBRjHaasWpxWQcFb7zMrClnM1yQnyvYCssZt0ow5jkcZLYVsEk3 c0XziZ6YfQ/WRX92FzBENRpSTtmiPTNyw4WE1xi78f5AM4FX9p2aBudIvQmyECGh LbL6zIfdkVXNwSezQziFhLdIx4tgP4C1PXbuT26IiS3FN7uLTovmozdRHHoz6Wsg w== 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=fm3; bh=GCOCdLBvER1uJBwqDC45zH4ip40h8 EDSqkmzj6WuqzU=; b=OMSf9dZuR5EciBZYw7arT4M33IWjH+Ipyhk6Cd7wYEOza HMk/7C/mj6f0/M8yxDOjreUfQh75YaBjABO/8bsuvZPjvjNTEG2qKyu3lgvslmV3 rYMKZTWZVAQWASYCBawcC403d7dEaQDbB6ktvqtHcMrpKbDtwJjffRcG7FLJVPrb DFPy6QA3t94cQWyzizf0hHmhExwOwtvQTYscmk84E9LGpgc7jdzNm02a3B9kkwGo Tt95wUjhhdunZJFqi2w0/VfS6YCobp5rPgUh5IHQn7R0KovLFxG43hHvnD/UQEu1 kRQ/y3ACK7zjDl5Eiv+J8omBHjVjbS+zJ50CcI2YA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudejiedgkeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfrhggtgfgsehtqhertdertdejnecuhfhrohhmpegkihcu jggrnhcuoeiiihdrhigrnhesshgvnhhtrdgtohhmqeenucggtffrrghtthgvrhhnpeekgf fgleejfeegjedttefhhedvgfffvdeffeekjeetgffhtedvudffkeegleettdenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeiiihdrhigrnhessh gvnhhtrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 6 Apr 2022 11:19:44 -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 , Zi Yan Subject: [PATCH v10 4/5] mm: cma: use pageblock_order as the single alignment Date: Wed, 6 Apr 2022 11:18:57 -0400 Message-Id: <20220406151858.3149821-5-zi.yan@sent.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220406151858.3149821-1-zi.yan@sent.com> References: <20220406151858.3149821-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=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 2148d3d00a70..29bb5177a7f5 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -9000,8 +9000,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