Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp742758pxp; Fri, 11 Mar 2022 13:58:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiugPihcmytqYNK3qjPGIr06kpOas5B1bMM4K6+SYADfIMdco6SajWCC1Ts6maaK23zV20 X-Received: by 2002:a17:902:eb85:b0:153:1405:9c85 with SMTP id q5-20020a170902eb8500b0015314059c85mr12310142plg.118.1647035888852; Fri, 11 Mar 2022 13:58:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647035888; cv=none; d=google.com; s=arc-20160816; b=Jw0yGiTcVUVYl42fyCrV0Ezwf0PtLs1uCPFmXwPXMnl5L+hyw7UjdvFTACMb2wYgVi htBrL+7qTa5oAU59zsRVWE3YNOF0K0kfwW6Vbq9VoQiiLb84g7+hwwpiwb34azmf7vKK 9YnI03Xh4JX9H/nDeOnIb9b7NgYhw3DvAz5UJtn8dfbNrYdbiYQddW189jZ4OMzJIjuf KBZSrEfwsBlrOS3EO9/sd2I9+Tp+Ldg8bUqXvBdDFzrxI+1LdANquOOuy8SHvxoGrMsd 4XklK0z3mfcHwD2DBb+VX1Oe9Eu9+APwHbwBsFq5R03zWFsyjkVAoFJdnI7H111PSzHM ktlw== 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=e95vsXP8jrOyuFrun5UmlX0V2bedBHGJryguMu0faC4=; b=i/5ftWXHCgLqkQgcpYSL+Gegk4y/nQov2Ayj8ZPv3USfFs2erl/xmFvNc/kzmc7V2I SzJO7+zcGn9HKgwyOiS6O9kMmuqUpBalRAgrVTOHaPQrFgD9jGwoS+44RxXmCijfB+om 9ALgZCojt5dGHE6pFUjZRAN5UwKcAWwni3LydOgYLIa1v9jWx595KyLT0ZaXdMDWuHA5 ayCjsRUF+nne+9PyzRUHYNKhmzkLbWQamNl0wYfP+yAXhlzpdBLj0MylLNkV8nozPw6h UxwuL/HV1ICjffr7Oz0Q+lZrT5Gi/VfgTmbHNkEr1yNxC2sNnV0CEAa5kx4nnzhLrDQP ruHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sent.com header.s=fm3 header.b="Aeu/f/mi"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=eGEV6CNW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j64-20020a638043000000b00380fd62eb67si3968442pgd.809.2022.03.11.13.58.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 13:58:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@sent.com header.s=fm3 header.b="Aeu/f/mi"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=eGEV6CNW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 E71F01E530C; Fri, 11 Mar 2022 13:15:11 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350967AbiCKSir (ORCPT + 99 others); Fri, 11 Mar 2022 13:38:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350924AbiCKSic (ORCPT ); Fri, 11 Mar 2022 13:38:32 -0500 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08BFC123BDB for ; Fri, 11 Mar 2022 10:37:24 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id D23855C020E; Fri, 11 Mar 2022 13:37:23 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 11 Mar 2022 13:37:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sent.com; h=cc :cc:content-transfer-encoding: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=e95vsXP8jrOyuF run5UmlX0V2bedBHGJryguMu0faC4=; b=Aeu/f/mie3aIVmoHLJLu/tlQwDCvFY dgFIDrQ3u3efDBP8d1yJFDb6Wr1haN+okgglNFCKK+8il1qJpEGp6UGl+b+lcTw2 ervx3bdd8lJbv4DrVFkSWJO47L/LDySOzOnHgq0eV9CBDkVSWw8bJM/RMzqu9oll M0oM8dGkri/a7XxCG1DWDOJI5PyVI1kciHH63VBf1Njc34RvogGhJv7mydwW7XrQ agENw2xGIEpPewdQaA2Ds10BJrE48guSK1sxkjhmf7ApOzz6KQzK1fK1iK3zeS8V dH0OlB9AOcJtxKhc3U6ltRAJ8LXIBuB7oyW2PhJJYRRbmegYptpOso/w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding: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= fm2; bh=e95vsXP8jrOyuFrun5UmlX0V2bedBHGJryguMu0faC4=; b=eGEV6CNW JSiOrcEAknykSvmnNrnSa3nWPACWWOH//RfoelfIROxsGSKlnq3CBKgrPvZ3Zo5G +QqBMgXHULRaClhLpIQEpvDfKUkG2OEYvJ7pafepuqteoDL7TsQtRhduvk7olpAF DalsICTswRSjeKpHBYL/2q69VNsj1HfrI3rXW9h4sIPO2BY2GUBDS54CiLmqjFD9 H8sKXMgoEieYhtWb8EylL1YUxz5hXQenNwHFz7L0tbr8gJvAmYVnLpobkejLQr/t 8FLAaAwwcg12WgXEbKOGlpzuwRLg8pRM8/smlN4zAAK/t+xLw7nWtOX3oyPwmqg6 ZtZeKgSa/MAZ7Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddvvddgudduvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhhrggfgsedtqhertdertddtnecuhfhrohhmpegkihcu jggrnhcuoeiiihdrhigrnhesshgvnhhtrdgtohhmqeenucggtffrrghtthgvrhhnpeeije euvdeuudeuhfeghfehieeuvdetvdeugfeigeevteeuieeuhedtgeduheefleenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeiiihdrhigrnhessh gvnhhtrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 11 Mar 2022 13:37:23 -0500 (EST) 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 v7 4/5] mm: cma: use pageblock_order as the single alignment Date: Fri, 11 Mar 2022 13:36:55 -0500 Message-Id: <20220311183656.1911811-5-zi.yan@sent.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220311183656.1911811-1-zi.yan@sent.com> References: <20220311183656.1911811-1-zi.yan@sent.com> Reply-To: Zi Yan MIME-Version: 1.0 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_order 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 962b14d403e8..0725c50ca0cb 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 c2db271b874f..0f96bd57c258 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -9065,8 +9065,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