linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Zhen Ni <zhen.ni@easystack.cn>
To: akpm@linux-foundation.org, vbabka@kernel.org
Cc: surenb@google.com, mhocko@suse.com, jackmanb@google.com,
	hannes@cmpxchg.org, ziy@nvidia.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, Zhen Ni <zhen.ni@easystack.cn>
Subject: [PATCH 1/3] mm/page_owner: add filter infrastructure
Date: Fri, 17 Apr 2026 23:46:36 +0800	[thread overview]
Message-ID: <20260417154638.22370-2-zhen.ni@easystack.cn> (raw)
In-Reply-To: <20260417154638.22370-1-zhen.ni@easystack.cn>

Add data structure for page_owner filtering functionality and create
debugfs directory for filter controls.

This adds:
- struct page_owner_filter with compact and nid fields
- Static owner_filter instance initialized with default values
- page_owner_filter debugfs directory

The filter infrastructure will be used to add compact mode and NUMA node
filtering capabilities in subsequent commits.

Signed-off-by: Zhen Ni <zhen.ni@easystack.cn>
---
 mm/page_owner.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/mm/page_owner.c b/mm/page_owner.c
index 8178e0be557f..6811439bf9e4 100644
--- a/mm/page_owner.c
+++ b/mm/page_owner.c
@@ -54,6 +54,16 @@ struct stack_print_ctx {
 	u8 flags;
 };
 
+struct page_owner_filter {
+	bool compact;
+	int nid;
+};
+
+static struct page_owner_filter owner_filter = {
+	.compact = false,
+	.nid = -1,
+};
+
 static bool page_owner_enabled __initdata;
 DEFINE_STATIC_KEY_FALSE(page_owner_inited);
 
@@ -973,7 +983,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 +991,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



  reply	other threads:[~2026-04-17 15:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-17 15:46 [PATCH 0/3] mm/page_owner: add filter infrastructure for compact mode and NUMA filtering Zhen Ni
2026-04-17 15:46 ` Zhen Ni [this message]
2026-04-17 15:46 ` [PATCH 2/3] mm/page_owner: add compact mode filter Zhen Ni
2026-04-17 15:55   ` Zi Yan
2026-04-17 15:46 ` [PATCH 3/3] mm/page_owner: add NUMA node filter Zhen Ni
2026-04-17 15:58   ` 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=20260417154638.22370-2-zhen.ni@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