Re: [PATCH v11 0/4] mm/page_owner: add per-fd filter infrastructure for print_mode and NUMA filtering

From: zhen.ni

Date: Thu Jun 25 2026 - 10:19:35 EST




在 2026/6/25 12:55, Andrew Morton 写道:
On Thu, 25 Jun 2026 12:30:57 +0800 Zhen Ni <zhen.ni@xxxxxxxxxxxx> wrote:

This patch series introduces per-file-descriptor filtering capabilities to the
page_owner feature.

Well, I assume this work was inspired by your own operational
experience with page_owner. There's no better inspiration than this!

Review is thin (absent) at v11. This is typical with page_owner
changes :(. I'll add the series for testing while interested people
check over it (please).

AI review might have found a few things which you might choose to
address. Please check it out:

https://sashiko.dev/#/patchset/20260625043101.338794-1-zhen.ni@xxxxxxxxxxxx




Hi,

Thanks for the review. Let me address the questions:

Q1: Can empty write silently revert concurrent filter changes?
Q3: Can concurrent writes clobber independent filter settings?

A1&3: Yes, this is theoretically possible when multiple threads share the same fd. The current implementation uses short-duration spinlocks as a practical trade-off rather than holding locks during the entire parsing process.

However, I believe the current design meets functional requirements:

1. Most users will use the page_owner_filter tool rather than programming against page_owner directly. For concurrent filtering needs, multiple processes can use independent file descriptors.

2. Even in the multi-threaded shared-fd case, the worst outcome is that
filter settings get overwritten. Since page_owner is a debug feature,
the impact is limited.

---

Q2: How can users disable/clear the NUMA node filter?

A2: Clearing the NUMA filter while holding the fd open is an edge case
without strong practical necessity. If users need to change filter behavior, they can simply:
- Apply a different filter in the next write operation, or
- Close and reopen the file descriptor

The filter is designed for targeted debugging sessions where the
configuration is set up front and used for the session.

If you believe that holding locks for the entire write process is
necessary, please let me know.


Thanks,
Zhen