From: "zhen.ni" <zhen.ni@easystack.cn>
To: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>,
"David Hildenbrand (Arm)" <david@kernel.org>
Cc: Zi Yan <ziy@nvidia.com>,
Andrew Morton <akpm@linux-foundation.org>,
"Liam R . Howlett" <liam@infradead.org>,
Vlastimil Babka <vbabka@kernel.org>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>, Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
Brendan Jackman <brendan.jackman@linux.dev>,
Johannes Weiner <hannes@cmpxchg.org>,
linux-mm@kvack.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 0/8] mm/page_owner: Add PID/TGID/COMM and cgroup filtering
Date: Sun, 20 Sep 2026 10:11:10 +0800 [thread overview]
Message-ID: <99a94068-ab37-47c0-878c-7c1ada5204b2@easystack.cn> (raw)
In-Reply-To: <aqPmlw8WYW9HSzIV@gremlin>
在 2026/9/11 19:32, Lorenzo Stoakes (ARM) 写道:
> On Fri, Sep 11, 2026 at 01:06:46PM +0200, David Hildenbrand (Arm) wrote:
>> On 9/11/26 09:58, zhen.ni wrote:
>>>
>>>
>>> 在 2026/9/9 23:54, Zi Yan 写道:
>>>> On 9 Sep 2026, at 6:28, David Hildenbrand (Arm) wrote:
>>>>
>>>>>
>>>>> Because it results in less kernel code :)
>>>>>
>>>>> And less kernel code is good. Unless unavoidable.
>>>>
>>>> An alternative is to add BPF hooks like bpf_iter to do the filtering
>>>> and by default, when no BPF program is attached, everything is printed.
>>>>
>>>>
>>>
>>> I’ve also thought about a similar approach—perhaps a new bpf_iter type
>>> that could iterate over all pages by PFN. The advantage would be that
>>> you can fully customize what you want to print and what you want to
>>> filter. However, doing so would require refactoring the entire
>>> page_owner, and I’m not sure whether it’s worth pursuing in this
>>> direction.I’d also like to hear everyone’s thoughts on this.
>>
>> Certainly better than having more and more manual filters added to the code base.
>
> Agreed.
>
> bpf seems the ideal fit here I think?
>
> Means that those who want this information can get it and those who don't are
> unaffected.
>
I have prototyped page_owner bpf_iter and confirmed it is a viable and
valuable direction:
1.Most parameter parsing is offloaded to the existing BPF verifier,
keeping the page_owner kernel-side logic simple.
2.Filtering and printing are delegated to the BPF program, providing
greater flexibility and enabling more complex composite filtering.
I plan to further refine this patch series, but it will likely be
submitted as a separate series, as it represents a different direction.
Thanks,
Zhen
next prev parent reply other threads:[~2026-09-20 3:27 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-07 8:26 Zhen Ni
2026-09-07 8:26 ` [PATCH v3 1/8] mm/page_owner: Add PID filtering support Zhen Ni
2026-09-07 8:26 ` [PATCH v3 2/8] mm/page_owner: Add TGID " Zhen Ni
2026-09-07 8:26 ` [PATCH v3 3/8] mm/page_owner: Add COMM filtering with wildcard support Zhen Ni
2026-09-07 8:26 ` [PATCH v3 4/8] mm/page_owner: Refactor memcg handling for cgroup filter support Zhen Ni
2026-09-07 8:26 ` [PATCH v3 5/8] mm/page_owner: Add memcg " Zhen Ni
2026-09-07 8:26 ` [PATCH v3 6/8] tools/mm: Add PID/TGID/COMM filtering support to page_owner_filter Zhen Ni
2026-09-07 8:26 ` [PATCH v3 7/8] tools/mm: Add memory cgroup " Zhen Ni
2026-09-07 8:26 ` [PATCH v3 8/8] Documentation: page_owner: Document PID/TGID/COMM and cgroup filters Zhen Ni
2026-09-07 11:39 ` [PATCH v3 0/8] mm/page_owner: Add PID/TGID/COMM and cgroup filtering zhen.ni
2026-09-08 14:30 ` David Hildenbrand (Arm)
2026-09-09 2:35 ` zhen.ni
2026-09-09 10:28 ` David Hildenbrand (Arm)
2026-09-09 15:54 ` Zi Yan
2026-09-11 7:58 ` zhen.ni
2026-09-11 11:06 ` David Hildenbrand (Arm)
2026-09-11 11:32 ` Lorenzo Stoakes (ARM)
2026-09-20 2:11 ` zhen.ni [this message]
2026-09-21 16:25 ` Zi Yan
2026-09-22 12:33 ` zhen.ni
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=99a94068-ab37-47c0-878c-7c1ada5204b2@easystack.cn \
--to=zhen.ni@easystack.cn \
--cc=akpm@linux-foundation.org \
--cc=brendan.jackman@linux.dev \
--cc=corbet@lwn.net \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=liam@infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=rdunlap@infradead.org \
--cc=rppt@kernel.org \
--cc=skhan@linuxfoundation.org \
--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
all inboxes | Powered by JetHome®