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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99666C5B543 for ; Wed, 4 Jun 2025 04:37:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 35CB06B0584; Wed, 4 Jun 2025 00:37:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 334CD6B0585; Wed, 4 Jun 2025 00:37:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 272376B0586; Wed, 4 Jun 2025 00:37:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 07AA76B0584 for ; Wed, 4 Jun 2025 00:37:10 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 749E7B7387 for ; Wed, 4 Jun 2025 04:37:09 +0000 (UTC) X-FDA: 83516458578.28.9DBD6F7 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf15.hostedemail.com (Postfix) with ESMTP id B7AE2A0007 for ; Wed, 4 Jun 2025 04:37:07 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf15.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1749011827; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l02vh8JakQNcImoUflnc9XgHbXRzottTvVuw4UXh8Fc=; b=nkgEwlJwy/W922j9QrmuFi2tVIHzAhrTHtZ5SgVNekPfjc6/7+29iGe7awZGMET584s4u/ 9RK74qJhQiSLhX5LyQSkDj74x9oqBfA0VxhuQsWnGuXK6alKqQMKFy4SpyfBnmUvSkD0WD kALMwEveuEVaqJe5dc46x0cRChHlWzk= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf15.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1749011827; a=rsa-sha256; cv=none; b=D3vDIteuANM2qcbdYmV64Ft8q2hECgm9D3j4j7P980C2i9ofVWEqR444Cw3L4PiKOAnBka SRYmU6J/NYcielAkA907jQUBJmox4CARoSVNJ5fLIzPZ02nvBhIuQvErUOz73gdewDYFTS n3KlfiY1Mmx9qIv/YuXHe1DNCvKDd/4= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DD46E1758; Tue, 3 Jun 2025 21:36:49 -0700 (PDT) Received: from [10.163.60.247] (unknown [10.163.60.247]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E011D3F673; Tue, 3 Jun 2025 21:36:59 -0700 (PDT) Message-ID: Date: Wed, 4 Jun 2025 10:06:54 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm: rename CONFIG_PAGE_BLOCK_ORDER to CONFIG_PAGE_BLOCK_ORDER_CEIL. To: Zi Yan , david@redhat.com Cc: Liam.Howlett@oracle.com, akpm@linux-foundation.org, isaacmanjarres@google.com, jyescas@google.com, kaleshsingh@google.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, lorenzo.stoakes@oracle.com, masahiroy@kernel.org, mhocko@suse.com, minchan@kernel.org, rppt@kernel.org, surenb@google.com, tjmercier@google.com, vbabka@suse.cz References: <20250603154843.1565239-1-ziy@nvidia.com> Content-Language: en-US From: Anshuman Khandual In-Reply-To: <20250603154843.1565239-1-ziy@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Stat-Signature: gkjy6xpkjz1gtugred1igpmri9wy5cg7 X-Rspamd-Queue-Id: B7AE2A0007 X-Rspam-User: X-Rspamd-Server: rspam02 X-HE-Tag: 1749011827-340735 X-HE-Meta: U2FsdGVkX18Q7aMMSap+NbrvTcrGQEG9fxO5U4PjVj9Xml+YB8pX2DJ2508s+/SyG1M/52wBjX0D8oiVM3Bbc4WTBLUqpChZTQ2Ri1opXA/vX8QvaBg5iylJDeVPlbp5y+exBpLgmj24g6ZBm82mqcQWkk70UtTuDkiaBYfcVnNskHDHRPpACMvBVTKcCVnyZRfc9MZ7tQjubFcPPSISnnKeiBw0emgsqCzHTBdNweSRBrkshx4srC/4a1Zz6YYIrYwtiMwsExLsUHMyT2jiaPSiUnjmhLSjjPUsPXUzshYyGL7vptATkxtvRpITUIZNqEcdBDgQV8b9ps1EBBRtdcNr4IyI39LpIY0q/MhTVcSAsR1rHAotqfdu6L7hWHQPIeeW8vVg+WC3E2UtJ+cINfoJ1I8vVAdrRAc+aIMu8yjlzmJin1g+OkRZgeUVBD5E6Lc4T442Gh4r98VGvcXf2+OnJBUWhyqykNJSv3ppdwjkGmAvBRET4LbdZhaeN2OB8NgqWmCrIz22oR+/7t5wd0FG8XO5DcOhJJ0q0ki2Q/knTl/6YGTWl+m9NvDmJCuM0M5gZZlaK1fhD1E2IUugJdxa/hRSqVZmA1wL5LoPwaBXr08vHyF8PpMLfBLbT2GL4AMxeFrI1mZgee93Tvd7F9DosMrkYrCl6hnIjOUDGjjlYjK59jONzaVk6otC4DwVjezYZwSM62tKZnYABra0pyWKXgPqv58rfQ+9bNJu7fhzKTom4T3AA0WWrKRtEsWr3cKJkptfP/uOuCad5N597rtlh8I8HEyXzI5Zd36tYJxgUgcPZtZfEN0cCTy4PKc3WU+vLoCW5q6JSnQlJaCRbnQKPbHmd1OjlKSu3h5qOALkxK4UZhqdLWaut+BbVBOkBAcwquAN7Qzm5T/YIxq/vQKAhehePH/8qMeRjmwSBABugaGv91FF++GtSTtJvDWlFfaW62yxWOCZWVrJWuw mBX87D70 4xjlE7nytRWazZZQ+ga/YlKXsbyyMyDvi43TamdOrmxy9hg45gB3RPm8AWUGYRNcczYytqX8aAq/6fnSl3f8/IKIIXM9WxA/pMw/UfKiSHmf0mACo76GGwJ4k6n0tTILtYCwD8F4c08y5PnCSBbGqZtLlyVR4CVetHEC6jTmDzoTwCcaPluwpeGAPjEXi4Klg1JporHVLKEeVS0pjuA6OgXcixw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 6/3/25 21:18, Zi Yan wrote: > The config is in fact an additional upper limit of pageblock_order, so > rename it to avoid confusion. Agreed. This new config has been similar to existing 'pageblock_order' that might cause confusion. Hence renaming makes sense. But instead of PAGE_BLOCK_ORDER_CEIL should it be rather PAGE_BLOCK_ORDER_MAX ? > > Fixes: e13e7922d034 ("mm: add CONFIG_PAGE_BLOCK_ORDER to select page block order") Does it really need a "Fixes: " tag given there is no problem to fix ? > Signed-off-by: Zi Yan > --- > include/linux/mmzone.h | 14 +++++++------- > include/linux/pageblock-flags.h | 8 ++++---- > mm/Kconfig | 15 ++++++++------- > 3 files changed, 19 insertions(+), 18 deletions(-) > > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 283913d42d7b..523b407e63e8 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -38,19 +38,19 @@ > #define NR_PAGE_ORDERS (MAX_PAGE_ORDER + 1) > > /* Defines the order for the number of pages that have a migrate type. */ > -#ifndef CONFIG_PAGE_BLOCK_ORDER > -#define PAGE_BLOCK_ORDER MAX_PAGE_ORDER > +#ifndef CONFIG_PAGE_BLOCK_ORDER_CEIL > +#define PAGE_BLOCK_ORDER_CEIL MAX_PAGE_ORDER > #else > -#define PAGE_BLOCK_ORDER CONFIG_PAGE_BLOCK_ORDER > -#endif /* CONFIG_PAGE_BLOCK_ORDER */ > +#define PAGE_BLOCK_ORDER_CEIL CONFIG_PAGE_BLOCK_ORDER_CEIL > +#endif /* CONFIG_PAGE_BLOCK_ORDER_CEIL */ > > /* > * The MAX_PAGE_ORDER, which defines the max order of pages to be allocated > - * by the buddy allocator, has to be larger or equal to the PAGE_BLOCK_ORDER, > + * by the buddy allocator, has to be larger or equal to the PAGE_BLOCK_ORDER_CEIL, > * which defines the order for the number of pages that can have a migrate type > */ > -#if (PAGE_BLOCK_ORDER > MAX_PAGE_ORDER) > -#error MAX_PAGE_ORDER must be >= PAGE_BLOCK_ORDER > +#if (PAGE_BLOCK_ORDER_CEIL > MAX_PAGE_ORDER) > +#error MAX_PAGE_ORDER must be >= PAGE_BLOCK_ORDER_CEIL > #endif > > /* > diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h > index e73a4292ef02..e7a86cd238c2 100644 > --- a/include/linux/pageblock-flags.h > +++ b/include/linux/pageblock-flags.h > @@ -41,18 +41,18 @@ extern unsigned int pageblock_order; > * Huge pages are a constant size, but don't exceed the maximum allocation > * granularity. > */ > -#define pageblock_order MIN_T(unsigned int, HUGETLB_PAGE_ORDER, PAGE_BLOCK_ORDER) > +#define pageblock_order MIN_T(unsigned int, HUGETLB_PAGE_ORDER, PAGE_BLOCK_ORDER_CEIL) > > #endif /* CONFIG_HUGETLB_PAGE_SIZE_VARIABLE */ > > #elif defined(CONFIG_TRANSPARENT_HUGEPAGE) > > -#define pageblock_order MIN_T(unsigned int, HPAGE_PMD_ORDER, PAGE_BLOCK_ORDER) > +#define pageblock_order MIN_T(unsigned int, HPAGE_PMD_ORDER, PAGE_BLOCK_ORDER_CEIL) > > #else /* CONFIG_TRANSPARENT_HUGEPAGE */ > > -/* If huge pages are not used, group by PAGE_BLOCK_ORDER */ > -#define pageblock_order PAGE_BLOCK_ORDER > +/* If huge pages are not used, group by PAGE_BLOCK_ORDER_CEIL */ > +#define pageblock_order PAGE_BLOCK_ORDER_CEIL > > #endif /* CONFIG_HUGETLB_PAGE */ > > diff --git a/mm/Kconfig b/mm/Kconfig > index eccb2e46ffcb..3b27e644bd1f 100644 > --- a/mm/Kconfig > +++ b/mm/Kconfig > @@ -1017,8 +1017,8 @@ config ARCH_FORCE_MAX_ORDER > # the default page block order is MAX_PAGE_ORDER (10) as per > # include/linux/mmzone.h. > # > -config PAGE_BLOCK_ORDER > - int "Page Block Order" > +config PAGE_BLOCK_ORDER_CEIL > + int "Page Block Order Upper Limit" > range 1 10 if ARCH_FORCE_MAX_ORDER = 0 > default 10 if ARCH_FORCE_MAX_ORDER = 0 > range 1 ARCH_FORCE_MAX_ORDER if ARCH_FORCE_MAX_ORDER != 0 > @@ -1026,12 +1026,13 @@ config PAGE_BLOCK_ORDER > help > The page block order refers to the power of two number of pages that > are physically contiguous and can have a migrate type associated to > - them. The maximum size of the page block order is limited by > - ARCH_FORCE_MAX_ORDER. > + them. The maximum size of the page block order is at least limited by > + ARCH_FORCE_MAX_ORDER/MAX_PAGE_ORDER. > > - This config allows overriding the default page block order when the > - page block order is required to be smaller than ARCH_FORCE_MAX_ORDER > - or MAX_PAGE_ORDER. > + This config adds a new upper limit of default page block > + order when the page block order is required to be smaller than > + ARCH_FORCE_MAX_ORDER/MAX_PAGE_ORDER or other limits > + (see include/linux/pageblock-flags.h for details). > > Reducing pageblock order can negatively impact THP generation > success rate. If your workloads uses THP heavily, please use this