@@ -24,10 +24,10 @@ fragmentation statistics can be obtained through gfp flag information of
2424each page. It is already implemented and activated if page owner is
2525enabled. Other usages are more than welcome.
2626
27- It can also be used to show all the stacks and their outstanding
28- allocations , which gives us a quick overview of where the memory is going
29- without the need to screen through all the pages and match the allocation
30- and free operation.
27+ It can also be used to show all the stacks and their current number of
28+ allocated base pages , which gives us a quick overview of where the memory
29+ is going without the need to screen through all the pages and match the
30+ allocation and free operation.
3131
3232page owner is disabled by default. So, if you'd like to use it, you need
3333to add "page_owner=on" to your boot cmdline. If the kernel is built
@@ -75,42 +75,45 @@ Usage
7575
7676 cat /sys/kernel/debug/page_owner_stacks/show_stacks > stacks.txt
7777 cat stacks.txt
78- prep_new_page+0xa9/0x120
79- get_page_from_freelist+0x7e6/0x2140
80- __alloc_pages+0x18a/0x370
81- new_slab+0xc8/0x580
82- ___slab_alloc+0x1f2/0xaf0
83- __slab_alloc.isra.86+0x22/0x40
84- kmem_cache_alloc+0x31b/0x350
85- __khugepaged_enter+0x39/0x100
86- dup_mmap+0x1c7/0x5ce
87- copy_process+0x1afe/0x1c90
88- kernel_clone+0x9a/0x3c0
89- __do_sys_clone+0x66/0x90
90- do_syscall_64+0x7f/0x160
91- entry_SYSCALL_64_after_hwframe+0x6c/0x74
92- stack_count: 234
78+ post_alloc_hook+0x177/0x1a0
79+ get_page_from_freelist+0xd01/0xd80
80+ __alloc_pages+0x39e/0x7e0
81+ allocate_slab+0xbc/0x3f0
82+ ___slab_alloc+0x528/0x8a0
83+ kmem_cache_alloc+0x224/0x3b0
84+ sk_prot_alloc+0x58/0x1a0
85+ sk_alloc+0x32/0x4f0
86+ inet_create+0x427/0xb50
87+ __sock_create+0x2e4/0x650
88+ inet_ctl_sock_create+0x30/0x180
89+ igmp_net_init+0xc1/0x130
90+ ops_init+0x167/0x410
91+ setup_net+0x304/0xa60
92+ copy_net_ns+0x29b/0x4a0
93+ create_new_namespaces+0x4a1/0x820
94+ nr_base_pages: 16
9395 ...
9496 ...
9597 echo 7000 > /sys/kernel/debug/page_owner_stacks/count_threshold
9698 cat /sys/kernel/debug/page_owner_stacks/show_stacks> stacks_7000.txt
9799 cat stacks_7000.txt
98- prep_new_page+0xa9/0x120
99- get_page_from_freelist+0x7e6/0x2140
100- __alloc_pages+0x18a/0x370
101- alloc_pages_mpol+0xdf/0x1e0
102- folio_alloc+0x14/0x50
103- filemap_alloc_folio+0xb0/0x100
104- page_cache_ra_unbounded+0x97/0x180
105- filemap_fault+0x4b4/0x1200
106- __do_fault+0x2d/0x110
107- do_pte_missing+0x4b0/0xa30
108- __handle_mm_fault+0x7fa/0xb70
109- handle_mm_fault+0x125/0x300
110- do_user_addr_fault+0x3c9/0x840
111- exc_page_fault+0x68/0x150
112- asm_exc_page_fault+0x22/0x30
113- stack_count: 8248
100+ post_alloc_hook+0x177/0x1a0
101+ get_page_from_freelist+0xd01/0xd80
102+ __alloc_pages+0x39e/0x7e0
103+ alloc_pages_mpol+0x22e/0x490
104+ folio_alloc+0xd5/0x110
105+ filemap_alloc_folio+0x78/0x230
106+ page_cache_ra_order+0x287/0x6f0
107+ filemap_get_pages+0x517/0x1160
108+ filemap_read+0x304/0x9f0
109+ xfs_file_buffered_read+0xe6/0x1d0 [xfs]
110+ xfs_file_read_iter+0x1f0/0x380 [xfs]
111+ __kernel_read+0x3b9/0x730
112+ kernel_read_file+0x309/0x4d0
113+ __do_sys_finit_module+0x381/0x730
114+ do_syscall_64+0x8d/0x150
115+ entry_SYSCALL_64_after_hwframe+0x62/0x6a
116+ nr_base_pages: 20824
114117 ...
115118
116119 cat /sys/kernel/debug/page_owner > page_owner_full.txt
0 commit comments