lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250924174023.261125-4-mfo@igalia.com>
Date: Wed, 24 Sep 2025 14:40:23 -0300
From: Mauricio Faria de Oliveira <mfo@...lia.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
	Vlastimil Babka <vbabka@...e.cz>
Cc: Oscar Salvador <osalvador@...e.de>,
	Suren Baghdasaryan <surenb@...gle.com>,
	Michal Hocko <mhocko@...e.com>,
	Brendan Jackman <jackmanb@...gle.com>,
	Johannes Weiner <hannes@...xchg.org>,
	Zi Yan <ziy@...dia.com>,
	linux-mm@...ck.org,
	linux-kernel@...r.kernel.org,
	kernel-dev@...lia.com
Subject: [PATCH 3/3] mm/page_owner: update Documentation with 'print_handle' and 'print_stack'

Describe and provide examples for 'print_handle' and 'print_stack'.

Signed-off-by: Mauricio Faria de Oliveira <mfo@...lia.com>
---
 Documentation/mm/page_owner.rst | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/Documentation/mm/page_owner.rst b/Documentation/mm/page_owner.rst
index 3a45a20fc05a..fac14ff2e4a5 100644
--- a/Documentation/mm/page_owner.rst
+++ b/Documentation/mm/page_owner.rst
@@ -27,7 +27,10 @@ enabled. Other usages are more than welcome.
 It can also be used to show all the stacks and their current number of
 allocated base pages, which gives us a quick overview of where the memory
 is going without the need to screen through all the pages and match the
-allocation and free operation.
+allocation and free operation. It's also possible to show only a numeric
+identifier of all the stacks (without stack traces) and their number of
+allocated base pages (faster to read and parse, eg, for monitoring) that
+can be matched with stacks later (options print_handle and print_stack).
 
 page owner is disabled by default. So, if you'd like to use it, you need
 to add "page_owner=on" to your boot cmdline. If the kernel is built
@@ -95,6 +98,7 @@ Usage
 	...
 	...
 	echo 7000 > /sys/kernel/debug/page_owner_stacks/count_threshold
+	echo 1 > /sys/kernel/debug/page_owner_stacks/print_handle
 	cat /sys/kernel/debug/page_owner_stacks/show_stacks> stacks_7000.txt
 	cat stacks_7000.txt
 	 post_alloc_hook+0x177/0x1a0
@@ -113,6 +117,15 @@ Usage
 	 __do_sys_finit_module+0x381/0x730
 	 do_syscall_64+0x8d/0x150
 	 entry_SYSCALL_64_after_hwframe+0x62/0x6a
+	handle: 42
+	nr_base_pages: 20824
+	...
+
+	echo 1 > /sys/kernel/debug/page_owner_stacks/print_handle
+	echo 0 > /sys/kernel/debug/page_owner_stacks/print_stack
+	cat /sys/kernel/debug/page_owner_stacks/show_stacks > handles_7000.txt
+	cat handles_7000.txt
+	handle: 42
 	nr_base_pages: 20824
 	...
 
-- 
2.48.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ