From: "zhen.ni" <zhen.ni@easystack.cn>
To: Zi Yan <ziy@nvidia.com>
Cc: akpm@linux-foundation.org, 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 v2 1/3] mm/page_owner: add filter infrastructure
Date: Tue, 28 Apr 2026 11:33:02 +0800 [thread overview]
Message-ID: <7944d24f-f29a-43b3-918b-ce25e7bae520@easystack.cn> (raw)
In-Reply-To: <12259EA6-2095-4F79-A7C4-E89DAFE9E8D6@nvidia.com>
在 2026/4/27 23:35, Zi Yan 写道:
> On 19 Apr 2026, at 11:55, Zhen Ni wrote:
>
>> Add data structure for page_owner filtering functionality and create
>> debugfs directory for filter controls.
>>
>> This adds:
>> - enum page_owner_print_mode with values for full_stack and stack_handle
>> - struct page_owner_filter with print_mode and nid_mask fields
>> - Static owner_filter instance initialized with default values
>> - page_owner_filter debugfs directory
>>
>> The filter infrastructure will be used to add print_mode and NUMA node
>> filtering capabilities in subsequent commits.
>>
>> Link: https://lore.kernel.org/linux-mm/20260417154638.22370-2-zhen.ni@easystack.cn/
>> Suggested-by: Zi Yan <ziy@nvidia.com>
>> Signed-off-by: Zhen Ni <zhen.ni@easystack.cn>
>> ---
>>
>> Changes in v2:
>> - Use enum page_owner_print_mode instead of bool 'compact' for better clarity
>> - Use nodemask_t instead of int 'nid' to support multi-node filtering
>> ---
>> mm/page_owner.c | 20 +++++++++++++++++++-
>> 1 file changed, 19 insertions(+), 1 deletion(-)
>
> The patch can be folded into Patch 2. Otherwise, these new types are not
> used and page_owner_filter folder is just empty.
>
Thanks for your review and suggestion.
I kept the 3-patch structure mainly for clear functional separation,
which also makes review easier. Patch 1 adds the infrastructure,
patch 2 adds print_mode filter, and patch 3 adds NUMA filter.
I discussed this with Andrew and he has already accepted the
current 3-patch structure into mm-new for testing. Since he's okay
with it and mentioned that bisection holes are acceptable in this
case, I'll keep the current structure in v3.
>>
>> diff --git a/mm/page_owner.c b/mm/page_owner.c
>> index 8178e0be557f..5884d883837e 100644
>> --- a/mm/page_owner.c
>> +++ b/mm/page_owner.c
>> @@ -54,6 +54,21 @@ struct stack_print_ctx {
>> u8 flags;
>> };
>>
>> +enum page_owner_print_mode {
>> + PAGE_OWNER_PRINT_FULL_STACK,
>> + PAGE_OWNER_PRINT_STACK_HANDLE,
>> +};
>> +
>> +struct page_owner_filter {
>> + enum page_owner_print_mode print_mode;
>> + nodemask_t nid_mask;
>> +};
>> +
>> +static struct page_owner_filter owner_filter = {
>> + .print_mode = PAGE_OWNER_PRINT_FULL_STACK,
>> + .nid_mask = NODE_MASK_NONE,
>> +};
>> +
>> static bool page_owner_enabled __initdata;
>> DEFINE_STATIC_KEY_FALSE(page_owner_inited);
>>
>> @@ -973,7 +988,7 @@ DEFINE_SIMPLE_ATTRIBUTE(page_owner_threshold_fops, &page_owner_threshold_get,
>>
>> static int __init pageowner_init(void)
>> {
>> - struct dentry *dir;
>> + struct dentry *dir, *filter_dir;
>>
>> if (!static_branch_unlikely(&page_owner_inited)) {
>> pr_info("page_owner is disabled\n");
>> @@ -981,6 +996,9 @@ static int __init pageowner_init(void)
>> }
>>
>> debugfs_create_file("page_owner", 0400, NULL, NULL, &page_owner_fops);
>> +
>> + filter_dir = debugfs_create_dir("page_owner_filter", NULL);
>> +
>> dir = debugfs_create_dir("page_owner_stacks", NULL);
>> debugfs_create_file("show_stacks", 0400, dir,
>> (void *)(STACK_PRINT_FLAG_STACK |
>> --
>> 2.20.1
>
>
> Best Regards,
> Yan, Zi
>
>
Best regards,
Zhen
next prev parent reply other threads:[~2026-04-28 3:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-19 15:55 [PATCH v2 0/3] mm/page_owner: add filter infrastructure for print_mode and NUMA filtering Zhen Ni
2026-04-19 15:55 ` [PATCH v2 1/3] mm/page_owner: add filter infrastructure Zhen Ni
2026-04-27 15:35 ` Zi Yan
2026-04-28 3:33 ` zhen.ni [this message]
2026-04-28 13:13 ` Zi Yan
2026-04-29 1:39 ` SeongJae Park
2026-04-29 11:22 ` zhen.ni
2026-04-29 11:28 ` Zi Yan
2026-04-19 15:55 ` [PATCH v2 2/3] mm/page_owner: add print_mode filter Zhen Ni
2026-04-27 15:43 ` Zi Yan
2026-04-28 3:36 ` zhen.ni
2026-04-28 13:20 ` Zi Yan
2026-04-29 11:42 ` zhen.ni
2026-04-19 15:55 ` [PATCH v2 3/3] mm/page_owner: add NUMA node filter with nodelist support Zhen Ni
2026-04-24 11:26 ` Andrew Morton
2026-04-24 20:15 ` Andrew Morton
2026-04-24 11:27 ` [PATCH v2 0/3] mm/page_owner: add filter infrastructure for print_mode and NUMA filtering Andrew Morton
2026-04-24 14:09 ` Andrew Morton
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=7944d24f-f29a-43b3-918b-ce25e7bae520@easystack.cn \
--to=zhen.ni@easystack.cn \
--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=ziy@nvidia.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