Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Zi Yan" <ziy@nvidia.com>
To: "Qi Xi" <xiqi2@huawei.com>, <akpm@linux-foundation.org>,
	<vbabka@kernel.org>
Cc: <longli@microsoft.com>, <kotaranov@microsoft.com>,
	<jan.kiszka@siemens.com>, <kbingham@kernel.org>,
	<surenb@google.com>, <mhocko@suse.com>,
	<brendan.jackman@linux.dev>, <hannes@cmpxchg.org>,
	<linux-hyperv@vger.kernel.org>, <linux-rdma@vger.kernel.org>,
	<netdev@vger.kernel.org>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>, <sunnanyong@huawei.com>,
	<wangkefeng.wang@huawei.com>
Subject: Re: [PATCH] mm: drop stale MAX_ORDER references
Date: Tue, 18 Aug 2026 15:19:01 -0400	[thread overview]
Message-ID: <DKSB92XOCV9N.2FQPF6H5EEB7J@nvidia.com> (raw)
In-Reply-To: <20260818122408.4182417-1-xiqi2@huawei.com>

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



      reply	other threads:[~2026-08-18 19:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18 12:24 [PATCH] mm: drop stale MAX_ORDER references Qi Xi
2026-08-18 19:19 ` Zi Yan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DKSB92XOCV9N.2FQPF6H5EEB7J@nvidia.com \
    --to=ziy@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=brendan.jackman@linux.dev \
    --cc=hannes@cmpxchg.org \
    --cc=jan.kiszka@siemens.com \
    --cc=kbingham@kernel.org \
    --cc=kotaranov@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=mhocko@suse.com \
    --cc=netdev@vger.kernel.org \
    --cc=sunnanyong@huawei.com \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=wangkefeng.wang@huawei.com \
    --cc=xiqi2@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox