All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/page_owner: document shell usage of page_owner filters
@ 2026-11-26 16:40 Mauricio Faria de Oliveira
  2026-11-27  1:29 ` Andrew Morton
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mauricio Faria de Oliveira @ 2026-11-26 16:40 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Liam R. Howlett,
	Vlastimil Babka, Mike Rapoport, Michal Hocko, Jonathan Corbet,
	Shuah Khan, Randy Dunlap, Zhen Ni
  Cc: kernel-dev, linux-mm, linux-doc, Mauricio Faria de Oliveira

Document how to use page_owner filters directly from the shell,
without relying on the page_owner_filter tool, with an example.

Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
---
Tested with `make htmldocs` and checking the change in a web browser.
---
 Documentation/mm/page_owner.rst | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/Documentation/mm/page_owner.rst b/Documentation/mm/page_owner.rst
index bd027377dff6ee8f06462884baee458d621686b7..11fdde0ab77d6610dc3ad2234e30238bcdf1f226 100644
--- a/Documentation/mm/page_owner.rst
+++ b/Documentation/mm/page_owner.rst
@@ -343,3 +343,21 @@ terminals you can run different filters simultaneously::
 
 	# Terminal 2: Filter node 1 (runs concurrently)
 	./page_owner_filter -n 1 > node1_output.txt
+
+The shell can also be used instead of the page_owner_filter tool, as long as the
+same file descriptor is used to write filter commands then read filtered output.
+For example, using file descriptor 3::
+
+	# Open file in read-write mode
+	exec 3<>/sys/kernel/debug/page_owner
+
+	# Write filter command(s)
+	echo 'mode=handle' >&3
+	# (and/or)
+	echo 'nid=0' >&3
+
+	# Read filtered output
+	cat <&3 >output.txt
+
+	# Close file
+	exec 3>&-

---
base-commit: 9437046953b2fb3bf55b36582450ea0267df82a7
change-id: 20261126-page_owner_filter_shell-efce38f24e20

Best regards,
-- 
Mauricio Faria de Oliveira <mfo@igalia.com>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/page_owner: document shell usage of page_owner filters
  2026-11-26 16:40 [PATCH] mm/page_owner: document shell usage of page_owner filters Mauricio Faria de Oliveira
@ 2026-11-27  1:29 ` Andrew Morton
  2026-11-27  1:30 ` + mm-page_owner-document-shell-usage-of-page_owner-filters.patch added to mm-new branch Andrew Morton
  2026-12-02  8:46 ` [PATCH] mm/page_owner: document shell usage of page_owner filters Vlastimil Babka (SUSE)
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2026-11-27  1:29 UTC (permalink / raw)
  To: Mauricio Faria de Oliveira
  Cc: David Hildenbrand, Liam R. Howlett, Vlastimil Babka,
	Mike Rapoport, Michal Hocko, Jonathan Corbet, Shuah Khan,
	Randy Dunlap, Zhen Ni, kernel-dev, linux-mm, linux-doc

On Thu, 26 Nov 2026 13:40:02 -0300 Mauricio Faria de Oliveira <mfo@igalia.com> wrote:

> Document how to use page_owner filters directly from the shell,
> without relying on the page_owner_filter tool, with an example.

Thanks.

If people don't want to use the tool then they can just look in
/sys/kernel/debug/page_owner and figure it out for themselves.  But...

> +	# Open file in read-write mode
> +	exec 3<>/sys/kernel/debug/page_owner
> +
> +	# Write filter command(s)
> +	echo 'mode=handle' >&3
> +	# (and/or)
> +	echo 'nid=0' >&3
> +
> +	# Read filtered output
> +	cat <&3 >output.txt
> +
> +	# Close file
> +	exec 3>&-

The need to do both "configure it" and "use it" using the same fd is a
bit subtle for script development so people may find this small
addition useful.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* + mm-page_owner-document-shell-usage-of-page_owner-filters.patch added to mm-new branch
  2026-11-26 16:40 [PATCH] mm/page_owner: document shell usage of page_owner filters Mauricio Faria de Oliveira
  2026-11-27  1:29 ` Andrew Morton
@ 2026-11-27  1:30 ` Andrew Morton
  2026-12-02  8:46 ` [PATCH] mm/page_owner: document shell usage of page_owner filters Vlastimil Babka (SUSE)
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2026-11-27  1:30 UTC (permalink / raw)
  To: mm-commits, zhen.ni, vbabka, skhan, rppt, rdunlap, mhocko, liam,
	kernel-dev, david, corbet, mfo, akpm


The patch titled
     Subject: mm/page_owner: document shell usage of page_owner filters
has been added to the -mm mm-new branch.  Its filename is
     mm-page_owner-document-shell-usage-of-page_owner-filters.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-page_owner-document-shell-usage-of-page_owner-filters.patch

This patch will later appear in the mm-new branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews.  Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.

The mm-new branch of mm.git is not included in linux-next

If a few days of testing in mm-new is successful, the patch will me moved
into mm.git's mm-unstable branch, which is included in linux-next

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days

------------------------------------------------------
From: Mauricio Faria de Oliveira <mfo@igalia.com>
Subject: mm/page_owner: document shell usage of page_owner filters
Date: Thu, 26 Nov 2026 13:40:02 -0300

Document how to use page_owner filters directly from the shell, without
relying on the page_owner_filter tool, with an example.

Link: https://patch.msgid.link/20261126-page_owner_filter_shell-v1-1-cbbcff2fcb08@igalia.com
Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Shuah Khan <skhan@linuxfoundation.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Zhen Ni <zhen.ni@easystack.cn>
Cc: <kernel-dev@igalia.com>

 Documentation/mm/page_owner.rst |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

--- a/Documentation/mm/page_owner.rst~mm-page_owner-document-shell-usage-of-page_owner-filters
+++ a/Documentation/mm/page_owner.rst
@@ -343,3 +343,21 @@ terminals you can run different filters
 
 	# Terminal 2: Filter node 1 (runs concurrently)
 	./page_owner_filter -n 1 > node1_output.txt
+
+The shell can also be used instead of the page_owner_filter tool, as long as the
+same file descriptor is used to write filter commands then read filtered output.
+For example, using file descriptor 3::
+
+	# Open file in read-write mode
+	exec 3<>/sys/kernel/debug/page_owner
+
+	# Write filter command(s)
+	echo 'mode=handle' >&3
+	# (and/or)
+	echo 'nid=0' >&3
+
+	# Read filtered output
+	cat <&3 >output.txt
+
+	# Close file
+	exec 3>&-
_

Patches currently in -mm which might be from mfo@igalia.com are

mm-page_owner-document-shell-usage-of-page_owner-filters.patch
scripts-bloat-o-meter-describe-output-fields-in-help-text.patch


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/page_owner: document shell usage of page_owner filters
  2026-11-26 16:40 [PATCH] mm/page_owner: document shell usage of page_owner filters Mauricio Faria de Oliveira
  2026-11-27  1:29 ` Andrew Morton
  2026-11-27  1:30 ` + mm-page_owner-document-shell-usage-of-page_owner-filters.patch added to mm-new branch Andrew Morton
@ 2026-12-02  8:46 ` Vlastimil Babka (SUSE)
  2 siblings, 0 replies; 4+ messages in thread
From: Vlastimil Babka (SUSE) @ 2026-12-02  8:46 UTC (permalink / raw)
  To: Mauricio Faria de Oliveira, Andrew Morton, David Hildenbrand,
	Liam R. Howlett, Mike Rapoport, Michal Hocko, Jonathan Corbet,
	Shuah Khan, Randy Dunlap, Zhen Ni
  Cc: kernel-dev, linux-mm, linux-doc

On 11/26/26 17:40, Mauricio Faria de Oliveira wrote:
> Document how to use page_owner filters directly from the shell,
> without relying on the page_owner_filter tool, with an example.
> 
> Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>

Acked-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>

> ---
> Tested with `make htmldocs` and checking the change in a web browser.
> ---
>  Documentation/mm/page_owner.rst | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/Documentation/mm/page_owner.rst b/Documentation/mm/page_owner.rst
> index bd027377dff6ee8f06462884baee458d621686b7..11fdde0ab77d6610dc3ad2234e30238bcdf1f226 100644
> --- a/Documentation/mm/page_owner.rst
> +++ b/Documentation/mm/page_owner.rst
> @@ -343,3 +343,21 @@ terminals you can run different filters simultaneously::
>  
>  	# Terminal 2: Filter node 1 (runs concurrently)
>  	./page_owner_filter -n 1 > node1_output.txt
> +
> +The shell can also be used instead of the page_owner_filter tool, as long as the
> +same file descriptor is used to write filter commands then read filtered output.
> +For example, using file descriptor 3::
> +
> +	# Open file in read-write mode
> +	exec 3<>/sys/kernel/debug/page_owner
> +
> +	# Write filter command(s)
> +	echo 'mode=handle' >&3
> +	# (and/or)
> +	echo 'nid=0' >&3
> +
> +	# Read filtered output
> +	cat <&3 >output.txt
> +
> +	# Close file
> +	exec 3>&-
> 
> ---
> base-commit: 9437046953b2fb3bf55b36582450ea0267df82a7
> change-id: 20261126-page_owner_filter_shell-efce38f24e20
> 
> Best regards,


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-12-02  8:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 16:40 [PATCH] mm/page_owner: document shell usage of page_owner filters Mauricio Faria de Oliveira
2026-11-27  1:29 ` Andrew Morton
2026-11-27  1:30 ` + mm-page_owner-document-shell-usage-of-page_owner-filters.patch added to mm-new branch Andrew Morton
2026-12-02  8:46 ` [PATCH] mm/page_owner: document shell usage of page_owner filters Vlastimil Babka (SUSE)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.