Skip to contentSkip to conversation

mm: rename CONFIG_PAGE_BLOCK_ORDER to CONFIG_PAGE_BLOCK_ORDER_CEIL.

PATCH Superseded Zi Yan 5 participants 8 messages Jun 3, 2025 – Jun 4, 2025

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Zi Yan

author reviewer
#0 lore raw

PATCH 1/1 mm: rename CONFIG_PAGE_BLOCK_ORDER to CONFIG_PAGE_BLOCK_ORDER_CEIL.

The config is in fact an additional upper limit of pageblock_order, so rename it to avoid confusion.

Fixes e13e7922d034 ("mm: add CONFIG_PAGE_BLOCK_ORDER to select page block order")
---
 include/linux/mmzone.h          | 14 +++++++-------
 include/linux/pageblock-flags.h |  8 ++++----
 mm/Kconfig                      | 15 ++++++++-------
 3 files changed, 19 insertions(+), 18 deletions(-)
include/linux/mmzone.h +7 -7
index 283913d42d7b..523b407e63e8 100644
@@ -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
 
 /*
include/linux/pageblock-flags.h +4 -4
index e73a4292ef02..e7a86cd238c2 100644
@@ -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 */
 
mm/Kconfig +8 -7
index eccb2e46ffcb..3b27e644bd1f 100644
@@ -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
Signature · 1 line
2.47.2
Acked-by on v1 1/1
#2 lore raw
In reply to Zi Yan
Quoted 105 lines · Zi Yan

The config is in fact an additional upper limit of pageblock_order, so rename it to avoid confusion.

Fixes e13e7922d034 ("mm: add CONFIG_PAGE_BLOCK_ORDER to select page block order")
---
 include/linux/mmzone.h          | 14 +++++++-------
 include/linux/pageblock-flags.h |  8 ++++----
 mm/Kconfig                      | 15 ++++++++-------
 3 files changed, 19 insertions(+), 18 deletions(-)
include/linux/mmzone.h +7 -7
index 283913d42d7b..523b407e63e8 100644
@@ -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
 
 /*
include/linux/pageblock-flags.h +4 -4
index e73a4292ef02..e7a86cd238c2 100644
@@ -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 */
 
mm/Kconfig +8 -8
index eccb2e46ffcb..3b27e644bd1f 100644
@@ -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
--
Quoted 1 line

2.47.2

Thanks
Juan

Quoted 1 line
#3 lore raw
In reply to Zi Yan
Quoted 2 lines · Zi Yan

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 ?

Quoted 2 lines
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 ?

Quoted 99 lines
---
 include/linux/mmzone.h          | 14 +++++++-------
 include/linux/pageblock-flags.h |  8 ++++----
 mm/Kconfig                      | 15 ++++++++-------
 3 files changed, 19 insertions(+), 18 deletions(-)
include/linux/mmzone.h +7 -7
index 283913d42d7b..523b407e63e8 100644
@@ -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
 
 /*
include/linux/pageblock-flags.h +4 -4
index e73a4292ef02..e7a86cd238c2 100644
@@ -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 */
 
mm/Kconfig +8 -7
index eccb2e46ffcb..3b27e644bd1f 100644
@@ -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
author reviewer
#4 lore raw
Quoted 7 lines · Anshuman Khandual
Quoted 2 lines · Zi Yan

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 ?

Or PAGE_BLOCK_MAX_ORDER?

Quoted 5 lines
Quoted 3 lines
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 ?

I have no strong opinion on this one.

If you like a different name, I can send v2 and drop Fixes.

--
Best Regards,
Yan, Zi

#5 lore raw
Quoted 11 lines · Zi Yan
Quoted 7 lines · Anshuman Khandual
Quoted 2 lines · Zi Yan

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 ?

Or PAGE_BLOCK_MAX_ORDER?

Would also work for me.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
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 ?

I have no strong opinion on this one.

Probably we want this to go into this release. No need for a Fixes: I assume.

Signature · 3 lines
Cheers,

David / dhildenb
author reviewer
#6 lore raw
Quoted 18 lines · David Hildenbrand
Quoted 11 lines · Zi Yan
Quoted 7 lines · Anshuman Khandual
Quoted 2 lines · Zi Yan

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 ?

Or PAGE_BLOCK_MAX_ORDER?

Would also work for me.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
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 ?

I have no strong opinion on this one.

Probably we want this to go into this release. No need for a Fixes: I assume.

OK. I will send v2 later today, so that Anshuman has a chance to reply to my new name.

V2 will has following changes:
1. the new name: PAGE_BLOCK_MAX_ORDER,
2. add the missing PAGE_BLOCK_ORDER rename in mm/mm_init.c[1]
3. drop the Fixes.

[1] https://lore.kernel.org/linux-mm/[email protected]/

--
Best Regards,
Yan, Zi