]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mm: rename CONFIG_PAGE_BLOCK_ORDER to CONFIG_PAGE_BLOCK_MAX_ORDER
authorZi Yan <ziy@nvidia.com>
Wed, 4 Jun 2025 21:14:27 +0000 (17:14 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 10 Jul 2025 05:41:56 +0000 (22:41 -0700)
The config is in fact an additional upper limit of pageblock_order, so
rename it to avoid confusion.

Link: https://lkml.kernel.org/r/20250604211427.1590859-1-ziy@nvidia.com
Signed-off-by: Zi Yan <ziy@nvidia.com>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Acked-by: Juan Yescas <jyescas@google.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: "Isaac J. Manjarres" <isaacmanjarres@google.com>
Cc: Kalesh Singh <kaleshsingh@google.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: T.J. Mercier <tjmercier@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/mmzone.h
include/linux/pageblock-flags.h
mm/Kconfig
mm/mm_init.c

index 283913d42d7b3b57a3db84ef7916ca03cabd4ae6..5bec8b1d0e665cb0d44fa91b2bb235385cc65dc2 100644 (file)
 #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_MAX_ORDER
+#define PAGE_BLOCK_MAX_ORDER MAX_PAGE_ORDER
 #else
-#define PAGE_BLOCK_ORDER CONFIG_PAGE_BLOCK_ORDER
-#endif /* CONFIG_PAGE_BLOCK_ORDER */
+#define PAGE_BLOCK_MAX_ORDER CONFIG_PAGE_BLOCK_MAX_ORDER
+#endif /* CONFIG_PAGE_BLOCK_MAX_ORDER */
 
 /*
  * 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_MAX_ORDER,
  * 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_MAX_ORDER > MAX_PAGE_ORDER)
+#error MAX_PAGE_ORDER must be >= PAGE_BLOCK_MAX_ORDER
 #endif
 
 /*
index e73a4292ef02e318019cf046187281411f01ec6a..6297c6343c55315bc1527081c115e3a2e8ff66f2 100644 (file)
@@ -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_MAX_ORDER)
 
 #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_MAX_ORDER)
 
 #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_MAX_ORDER */
+#define pageblock_order                PAGE_BLOCK_MAX_ORDER
 
 #endif /* CONFIG_HUGETLB_PAGE */
 
index 15716b1a5e21cd239c1beb036f5e3bb4a555eb09..3b2060a61c05d911f4222c9b52c02acd7ef53cd1 100644 (file)
@@ -1005,8 +1005,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_MAX_ORDER
+       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
@@ -1014,12 +1014,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 use THP heavily, please use this
index f2944748f526d411d3caa52b32fb6a2b62d0b66c..02f41e2bdf60fe9d5f2dd9a8ccf5e6cae2fedb39 100644 (file)
@@ -1509,7 +1509,7 @@ static inline void setup_usemap(struct zone *zone) {}
 /* Initialise the number of pages represented by NR_PAGEBLOCK_BITS */
 void __init set_pageblock_order(void)
 {
-       unsigned int order = PAGE_BLOCK_ORDER;
+       unsigned int order = PAGE_BLOCK_MAX_ORDER;
 
        /* Check that pageblock_nr_pages has not already been setup */
        if (pageblock_order)