From: "Zi Yan" <ziy@nvidia.com>
To: "Zhen Ni" <zhen.ni@easystack.cn>, <akpm@linux-foundation.org>
Cc: <vbabka@kernel.org>, <surenb@google.com>, <mhocko@suse.com>,
<jackmanb@google.com>, <hannes@cmpxchg.org>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v11 2/4] mm/page_owner: add NUMA node filter
Date: Thu, 25 Jun 2026 15:27:57 -0400 [thread overview]
Message-ID: <DJIDMIBR7QP0.14KBT460GECAV@nvidia.com> (raw)
In-Reply-To: <20260625043101.338794-3-zhen.ni@easystack.cn>
On Thu Jun 25, 2026 at 12:30 AM EDT, Zhen Ni wrote:
> Add NUMA node filtering functionality to page_owner to allow filtering
> pages by specific NUMA node(s). This is useful for NUMA-aware memory
> allocation analysis and debugging.
>
> The filter supports flexible input formats:
> - Single node: nid=0
> - Multiple nodes: nid=0,2,3
> - Node range: nid=0-3
> - Mixed format: nid=0,2-4,7
>
> Example usage:
> # Using the page_owner_filter tool (recommended)
> ./page_owner_filter -n 0-3
> ./page_owner_filter -m stack_handle -n 0,2-4,7
>
> The implementation uses per-file-descriptor filter state stored in
> file->private_data, allowing each opener to have independent filter
> configuration. It uses nodemask_t for efficient multi-node filtering and
> nodelist_parse() for flexible input parsing. Node validity is verified
> using nodes_subset() to reject nodes without memory.
>
> Signed-off-by: Zhen Ni <zhen.ni@easystack.cn>
> ---
<snip>
>
> /*
> * Maximum input length for filter commands:
> - * 32: print_mode command max length is 17 ("mode=stack_handle").
> + * - 32: print_mode command max length is 17 ("mode=stack_handle")
> + * with sufficient buffer
> + * - 6 * MAX_NUMNODES: worst case for nid list
> + * Worst case per node: ",NNNNN" (comma + 5-digit node number) = 6 bytes
> */
> - max_input_len = 32;
> + max_input_len = 32 + 6 * MAX_NUMNODES;
>
> if (count > max_input_len)
> return -EINVAL;
Hi Andrew,
This needs to be fixed as well.
--
Best Regards,
Yan, Zi
next prev parent reply other threads:[~2026-06-25 19:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-25 4:30 [PATCH v11 0/4] mm/page_owner: add per-fd filter infrastructure for print_mode and NUMA filtering Zhen Ni
2026-06-25 4:30 ` [PATCH v11 1/4] mm/page_owner: add print_mode filter Zhen Ni
2026-06-25 18:26 ` Zi Yan
2026-06-25 19:20 ` Andrew Morton
2026-06-25 19:24 ` Zi Yan
2026-06-25 4:30 ` [PATCH v11 2/4] mm/page_owner: add NUMA node filter Zhen Ni
2026-06-25 18:37 ` Zi Yan
2026-06-26 8:20 ` zhen.ni
2026-06-25 19:27 ` Zi Yan [this message]
2026-06-25 20:04 ` Andrew Morton
2026-06-25 4:31 ` [PATCH v11 3/4] tools/mm: add page_owner_filter userspace tool Zhen Ni
2026-06-25 4:50 ` Andrew Morton
2026-06-25 4:31 ` [PATCH v11 4/4] mm/page_owner: document page_owner filter Zhen Ni
2026-06-25 4:55 ` [PATCH v11 0/4] mm/page_owner: add per-fd filter infrastructure for print_mode and NUMA filtering Andrew Morton
2026-06-25 12:57 ` zhen.ni
2026-06-25 18:22 ` Zi Yan
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=DJIDMIBR7QP0.14KBT460GECAV@nvidia.com \
--to=ziy@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=jackmanb@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
--cc=zhen.ni@easystack.cn \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.