From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3125C433FE for ; Thu, 17 Mar 2022 15:38:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235984AbiCQPjP (ORCPT ); Thu, 17 Mar 2022 11:39:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235959AbiCQPjG (ORCPT ); Thu, 17 Mar 2022 11:39:06 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F28CF20C194 for ; Thu, 17 Mar 2022 08:37:49 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 54EC95C080D; Thu, 17 Mar 2022 11:37:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 17 Mar 2022 11:37:49 -0400 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=UWqNf3Kd8KaotX/ss1294lyy7fSU7G dgiWKlnTxajt1HhcH88NGj9IWgd8aml2RydYGNAgtCZJiT3xL808/6YLwJ4doshL 9Bnw1yBPNfPjGUviYLX7IAmLSycPZnl2vMEhSbHr6ylCATHdS8fHf2TgO6qva2NW uiJhg/YP33v8zC8w+c5bWv+ncmXmsiET5vfvLdPViP8ZLV4v8Prf4hY6FPhi/5lA 2+0nRXVNzWjYwPennFl+yVmqkVDhWryDVasUkDfSNf7HDAxVJ9dOeu4MFf5WOgLy pvf27NS8ipIvVyTuVMdbG1degJ51OwZ+3r7iG3ffXF7ahWy6BuC6RHqQ== 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= fm3; bh=e95vsXP8jrOyuFrun5UmlX0V2bedBHGJryguMu0faC4=; b=ba2pks95 Vd3e2+EnF27pbioPl7YMlxl+GINDwzJWSw2bAdNaOdkDPcQy5wP/mrhjnVWGAeuz pTIp0R0sWJvPdi66QM8lPjgmbvhHfUov9kien+UlOGihGryV6SAUEgYbhBFK9jh2 O0NjVqjNBZud4Fa6g9NtdFqFv/xv1A+HHUfm+rg1PS5PjPq2LSsF8Q49//0jv5Bm Pz15x09QegkYcTe/ZGWPZPwVyN2iSjBj2ifb+LIP2AFvxtx2L1Ytcmwf8XmRoT2j d+iI7SyBCgYGsEhzGa+Rt5m4VvZpCFxQQpK5zdir+wUAtu5v5FXWkfV6onILxl2W K3CpdNuVgpBqlQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudefgedgjeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfrhgggfestdhqredtredttdenucfhrhhomhepkghiucgj rghnuceoiihirdihrghnsehsvghnthdrtghomheqnecuggftrfgrthhtvghrnhepieejue dvueduuefhgefhheeiuedvtedvuefgieegveetueeiueehtdegudehfeelnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepiihirdihrghnsehsvg hnthdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 17 Mar 2022 11:37:48 -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 v8 4/5] mm: cma: use pageblock_order as the single alignment Date: Thu, 17 Mar 2022 11:37:32 -0400 Message-Id: <20220317153733.2171277-5-zi.yan@sent.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220317153733.2171277-1-zi.yan@sent.com> References: <20220317153733.2171277-1-zi.yan@sent.com> Reply-To: Zi Yan MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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