* [PATCH] mm: drop stale MAX_ORDER references
@ 2026-08-18 12:24 Qi Xi
2026-08-18 19:19 ` Zi Yan
0 siblings, 1 reply; 2+ messages in thread
From: Qi Xi @ 2026-08-18 12:24 UTC (permalink / raw)
To: akpm, vbabka
Cc: longli, kotaranov, jan.kiszka, kbingham, surenb, mhocko,
brendan.jackman, hannes, ziy, linux-hyperv, linux-rdma, netdev,
linux-mm, linux-kernel, sunnanyong, wangkefeng.wang, xiqi2
The treewide rename in commit 5e0a760b4441 ("mm, treewide: rename
MAX_ORDER to MAX_PAGE_ORDER") left a few spots still using the old
name:
- two comments in include/net/mana/mana.h and mm/page_alloc.c;
- the gdb helper scripts/gdb/linux/mm.py, where self.MAX_ORDER is
a local mirror of the kernel's MAX_ORDER define.
Rename the leftover instances to MAX_PAGE_ORDER so the tree is
consistent.
No functional changes.
Signed-off-by: Qi Xi <xiqi2@huawei.com>
---
include/net/mana/mana.h | 4 ++--
mm/page_alloc.c | 2 +-
scripts/gdb/linux/mm.py | 8 ++++----
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h
index 04acb6791dbd..1d5bed71d6a7 100644
--- a/include/net/mana/mana.h
+++ b/include/net/mana/mana.h
@@ -40,8 +40,8 @@ enum TRI_STATE {
#define COMP_ENTRY_SIZE 64
/* This Max value for RX buffers is derived from __alloc_page()'s max page
- * allocation calculation. It allows maximum 2^(MAX_ORDER -1) pages. RX buffer
- * size beyond this value gets rejected by __alloc_page() call.
+ * allocation calculation. It allows maximum 2^(MAX_PAGE_ORDER -1) pages. RX
+ * buffer size beyond this value gets rejected by __alloc_page() call.
*/
#define MAX_RX_BUFFERS_PER_QUEUE 8192
#define DEF_RX_BUFFERS_PER_QUEUE 1024
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index ee902a468c2f..42b5b41432c5 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -7803,7 +7803,7 @@ static bool cond_accept_memory(struct zone *zone, unsigned int order,
/*
* Watermarks have not been initialized yet.
*
- * Accepting one MAX_ORDER page to ensure progress.
+ * Accepting one MAX_PAGE_ORDER page to ensure progress.
*/
if (!wmark)
return try_to_accept_memory_one(zone);
diff --git a/scripts/gdb/linux/mm.py b/scripts/gdb/linux/mm.py
index dffadccbb01d..28d33624c38b 100644
--- a/scripts/gdb/linux/mm.py
+++ b/scripts/gdb/linux/mm.py
@@ -56,7 +56,7 @@ class x86_page_ops():
self.MAX_PHYSMEM_BITS = 46
self.SECTION_SIZE_BITS = 27
- self.MAX_ORDER = 10
+ self.MAX_PAGE_ORDER = 10
self.SECTIONS_SHIFT = self.MAX_PHYSMEM_BITS - self.SECTION_SIZE_BITS
self.NR_MEM_SECTIONS = 1 << self.SECTIONS_SHIFT
@@ -233,11 +233,11 @@ class aarch64_page_ops():
self.SECTIONS_SHIFT = self.MAX_PHYSMEM_BITS - self.SECTION_SIZE_BITS
if str(constants.LX_CONFIG_ARCH_FORCE_MAX_ORDER).isdigit():
- self.MAX_ORDER = constants.LX_CONFIG_ARCH_FORCE_MAX_ORDER
+ self.MAX_PAGE_ORDER = constants.LX_CONFIG_ARCH_FORCE_MAX_ORDER
else:
- self.MAX_ORDER = 10
+ self.MAX_PAGE_ORDER = 10
- self.MAX_ORDER_NR_PAGES = 1 << (self.MAX_ORDER)
+ self.MAX_ORDER_NR_PAGES = 1 << (self.MAX_PAGE_ORDER)
self.PFN_SECTION_SHIFT = self.SECTION_SIZE_BITS - self.PAGE_SHIFT
self.NR_MEM_SECTIONS = 1 << self.SECTIONS_SHIFT
self.PAGES_PER_SECTION = 1 << self.PFN_SECTION_SHIFT
--
2.33.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mm: drop stale MAX_ORDER references
2026-08-18 12:24 [PATCH] mm: drop stale MAX_ORDER references Qi Xi
@ 2026-08-18 19:19 ` Zi Yan
0 siblings, 0 replies; 2+ messages in thread
From: Zi Yan @ 2026-08-18 19:19 UTC (permalink / raw)
To: Qi Xi, akpm, vbabka
Cc: longli, kotaranov, jan.kiszka, kbingham, surenb, mhocko,
brendan.jackman, hannes, linux-hyperv, linux-rdma, netdev,
linux-mm, linux-kernel, sunnanyong, wangkefeng.wang
On Tue Aug 18, 2026 at 8:24 AM EDT, Qi Xi wrote:
> The treewide rename in commit 5e0a760b4441 ("mm, treewide: rename
> MAX_ORDER to MAX_PAGE_ORDER") left a few spots still using the old
> name:
>
> - two comments in include/net/mana/mana.h and mm/page_alloc.c;
> - the gdb helper scripts/gdb/linux/mm.py, where self.MAX_ORDER is
> a local mirror of the kernel's MAX_ORDER define.
>
> Rename the leftover instances to MAX_PAGE_ORDER so the tree is
> consistent.
>
> No functional changes.
>
> Signed-off-by: Qi Xi <xiqi2@huawei.com>
> ---
> include/net/mana/mana.h | 4 ++--
> mm/page_alloc.c | 2 +-
> scripts/gdb/linux/mm.py | 8 ++++----
> 3 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h
> index 04acb6791dbd..1d5bed71d6a7 100644
> --- a/include/net/mana/mana.h
> +++ b/include/net/mana/mana.h
> @@ -40,8 +40,8 @@ enum TRI_STATE {
> #define COMP_ENTRY_SIZE 64
>
> /* This Max value for RX buffers is derived from __alloc_page()'s max page
> - * allocation calculation. It allows maximum 2^(MAX_ORDER -1) pages. RX buffer
> - * size beyond this value gets rejected by __alloc_page() call.
> + * allocation calculation. It allows maximum 2^(MAX_PAGE_ORDER -1) pages. RX
It should be 2^MAX_PAGE_ORDER here, since MAX_PAGE_ORDER is inclusive
now.
> + * buffer size beyond this value gets rejected by __alloc_page() call.
> */
> #define MAX_RX_BUFFERS_PER_QUEUE 8192
> #define DEF_RX_BUFFERS_PER_QUEUE 1024
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index ee902a468c2f..42b5b41432c5 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -7803,7 +7803,7 @@ static bool cond_accept_memory(struct zone *zone, unsigned int order,
> /*
> * Watermarks have not been initialized yet.
> *
> - * Accepting one MAX_ORDER page to ensure progress.
> + * Accepting one MAX_PAGE_ORDER page to ensure progress.
> */
> if (!wmark)
> return try_to_accept_memory_one(zone);
> diff --git a/scripts/gdb/linux/mm.py b/scripts/gdb/linux/mm.py
> index dffadccbb01d..28d33624c38b 100644
> --- a/scripts/gdb/linux/mm.py
> +++ b/scripts/gdb/linux/mm.py
> @@ -56,7 +56,7 @@ class x86_page_ops():
>
> self.MAX_PHYSMEM_BITS = 46
> self.SECTION_SIZE_BITS = 27
> - self.MAX_ORDER = 10
> + self.MAX_PAGE_ORDER = 10
>
> self.SECTIONS_SHIFT = self.MAX_PHYSMEM_BITS - self.SECTION_SIZE_BITS
> self.NR_MEM_SECTIONS = 1 << self.SECTIONS_SHIFT
> @@ -233,11 +233,11 @@ class aarch64_page_ops():
> self.SECTIONS_SHIFT = self.MAX_PHYSMEM_BITS - self.SECTION_SIZE_BITS
>
> if str(constants.LX_CONFIG_ARCH_FORCE_MAX_ORDER).isdigit():
> - self.MAX_ORDER = constants.LX_CONFIG_ARCH_FORCE_MAX_ORDER
> + self.MAX_PAGE_ORDER = constants.LX_CONFIG_ARCH_FORCE_MAX_ORDER
> else:
> - self.MAX_ORDER = 10
> + self.MAX_PAGE_ORDER = 10
>
> - self.MAX_ORDER_NR_PAGES = 1 << (self.MAX_ORDER)
> + self.MAX_ORDER_NR_PAGES = 1 << (self.MAX_PAGE_ORDER)
> self.PFN_SECTION_SHIFT = self.SECTION_SIZE_BITS - self.PAGE_SHIFT
> self.NR_MEM_SECTIONS = 1 << self.SECTIONS_SHIFT
> self.PAGES_PER_SECTION = 1 << self.PFN_SECTION_SHIFT
The rest looks good to me.
With the comment in mana.h fixed, feel free to add
Reviewed-by: Zi Yan <ziy@nvidia.com>
--
Best Regards,
Yan, Zi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-18 19:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-18 12:24 [PATCH] mm: drop stale MAX_ORDER references Qi Xi
2026-08-18 19:19 ` Zi Yan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox