Skip to content

Commit 20e845d

Browse files
mudongliangJonathan Corbet
authored andcommitted
docs/zh_CN: update the translation of mm/page_owner.rst
Update to commit f5c1210 ("mm,page_owner: fix refcount imbalance") Documentation/translations/zh_CN/mm/page_owner.rst commit f5c1210 ("mm,page_owner: fix refcount imbalance") commit ba6fe53 ("mm,page_owner: update Documentation regarding page_owner_stacks") 2 commits needs resolving in total Signed-off-by: Dongliang Mu <[email protected]> Reviewed-by: Alex Shi <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]> Message-ID: <38a9d8868e0f98dc5d2a08fb865313cc4db943a3.1729327831.git.dzm91@hust.edu.cn>
1 parent 9d197b6 commit 20e845d

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

Documentation/translations/zh_CN/mm/page_owner.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ page owner是用来追踪谁分配的每一个页面。它可以用来调试内
2626
页面所有者也可以用于各种目的。例如,可以通过每个页面的gfp标志信息获得精确的碎片
2727
统计。如果启用了page owner,它就已经实现并激活了。我们非常欢迎其他用途。
2828

29+
它也可以用来显示所有的栈以及它们当前分配的基础页面数,这让我们能够快速了解内存的
30+
使用情况,而无需浏览所有页面并匹配分配和释放操作。
31+
2932
page owner在默认情况下是禁用的。所以,如果你想使用它,你需要在你的启动cmdline
3033
中加入"page_owner=on"。如果内核是用page owner构建的,并且由于没有启用启动
3134
选项而在运行时禁用page owner,那么运行时的开销是很小的。如果在运行时禁用,它不
@@ -60,6 +63,49 @@ page owner在默认情况下是禁用的。所以,如果你想使用它,你
6063

6164
4) 分析来自页面所有者的信息::
6265

66+
cat /sys/kernel/debug/page_owner_stacks/show_stacks > stacks.txt
67+
cat stacks.txt
68+
post_alloc_hook+0x177/0x1a0
69+
get_page_from_freelist+0xd01/0xd80
70+
__alloc_pages+0x39e/0x7e0
71+
allocate_slab+0xbc/0x3f0
72+
___slab_alloc+0x528/0x8a0
73+
kmem_cache_alloc+0x224/0x3b0
74+
sk_prot_alloc+0x58/0x1a0
75+
sk_alloc+0x32/0x4f0
76+
inet_create+0x427/0xb50
77+
__sock_create+0x2e4/0x650
78+
inet_ctl_sock_create+0x30/0x180
79+
igmp_net_init+0xc1/0x130
80+
ops_init+0x167/0x410
81+
setup_net+0x304/0xa60
82+
copy_net_ns+0x29b/0x4a0
83+
create_new_namespaces+0x4a1/0x820
84+
nr_base_pages: 16
85+
...
86+
...
87+
echo 7000 > /sys/kernel/debug/page_owner_stacks/count_threshold
88+
cat /sys/kernel/debug/page_owner_stacks/show_stacks> stacks_7000.txt
89+
cat stacks_7000.txt
90+
post_alloc_hook+0x177/0x1a0
91+
get_page_from_freelist+0xd01/0xd80
92+
__alloc_pages+0x39e/0x7e0
93+
alloc_pages_mpol+0x22e/0x490
94+
folio_alloc+0xd5/0x110
95+
filemap_alloc_folio+0x78/0x230
96+
page_cache_ra_order+0x287/0x6f0
97+
filemap_get_pages+0x517/0x1160
98+
filemap_read+0x304/0x9f0
99+
xfs_file_buffered_read+0xe6/0x1d0 [xfs]
100+
xfs_file_read_iter+0x1f0/0x380 [xfs]
101+
__kernel_read+0x3b9/0x730
102+
kernel_read_file+0x309/0x4d0
103+
__do_sys_finit_module+0x381/0x730
104+
do_syscall_64+0x8d/0x150
105+
entry_SYSCALL_64_after_hwframe+0x62/0x6a
106+
nr_base_pages: 20824
107+
...
108+
63109
cat /sys/kernel/debug/page_owner > page_owner_full.txt
64110
./page_owner_sort page_owner_full.txt sorted_page_owner.txt
65111

0 commit comments

Comments
 (0)