Re: [PATCH v2 3/3] mm/page_owner: add NUMA node filter with nodelist support
From: Andrew Morton
Date: Fri Apr 24 2026 - 16:15:10 EST
On Sun, 19 Apr 2026 23:55:40 +0800 Zhen Ni <zhen.ni@xxxxxxxxxxxx> wrote:
> Add NUMA node filtering functionality to page_owner to allow
> filtering pages by specific NUMA node(s) using nodelist format.
>
> The filter allows users to focus on pages from specific NUMA nodes,
> which is useful for NUMA-aware memory allocation analysis and debugging.
AI review
(https://sashiko.dev/#/patchset/20260419155540.376847-1-zhen.ni@xxxxxxxxxxxx)
wonders if it's legitimate to use READ_ONCE/WRITE_ONCE against a
nodemask_t. And indeed, my x86_64 allmodconfig hit compile time
asserts over this.
So I took them out:
--- a/mm/page_owner.c~mm-page_owner-add-numa-node-filter-with-nodelist-support-fix
+++ a/mm/page_owner.c
@@ -732,7 +732,7 @@ read_page_owner(struct file *file, char
continue;
/* NUMA node filter using bitmask */
- mask = READ_ONCE(owner_filter.nid_mask);
+ mask = owner_filter.nid_mask;
if (!nodes_empty(mask)) {
int nid = page_to_nid(page);
@@ -1049,7 +1049,7 @@ static ssize_t nid_filter_write(struct f
goto out_free;
}
- WRITE_ONCE(owner_filter.nid_mask, mask);
+ owner_filter.nid_mask = mask;
ret = count;
out_free:
@@ -1059,7 +1059,7 @@ out_free:
static int nid_filter_show(struct seq_file *m, void *v)
{
- nodemask_t mask = READ_ONCE(owner_filter.nid_mask);
+ nodemask_t mask = owner_filter.nid_mask;
if (nodes_empty(mask))
seq_puts(m, "-1\n");
_