.. | .. |
---|
18 | 18 | using it for analyzing who allocate each page is rather complex. We need |
---|
19 | 19 | to enlarge the trace buffer for preventing overlapping until userspace |
---|
20 | 20 | program launched. And, launched program continually dump out the trace |
---|
21 | | -buffer for later analysis and it would change system behviour with more |
---|
| 21 | +buffer for later analysis and it would change system behaviour with more |
---|
22 | 22 | possibility rather than just keeping it in memory, so bad for debugging. |
---|
23 | 23 | |
---|
24 | 24 | page owner can also be used for various purposes. For example, accurate |
---|
.. | .. |
---|
41 | 41 | - Without page owner:: |
---|
42 | 42 | |
---|
43 | 43 | text data bss dec hex filename |
---|
44 | | - 40662 1493 644 42799 a72f mm/page_alloc.o |
---|
| 44 | + 48392 2333 644 51369 c8a9 mm/page_alloc.o |
---|
45 | 45 | |
---|
46 | 46 | - With page owner:: |
---|
47 | 47 | |
---|
48 | 48 | text data bss dec hex filename |
---|
49 | | - 40892 1493 644 43029 a815 mm/page_alloc.o |
---|
50 | | - 1427 24 8 1459 5b3 mm/page_ext.o |
---|
51 | | - 2722 50 0 2772 ad4 mm/page_owner.o |
---|
| 49 | + 48800 2445 644 51889 cab1 mm/page_alloc.o |
---|
| 50 | + 6662 108 29 6799 1a8f mm/page_owner.o |
---|
| 51 | + 1025 8 8 1041 411 mm/page_ext.o |
---|
52 | 52 | |
---|
53 | | -Although, roughly, 4 KB code is added in total, page_alloc.o increase by |
---|
54 | | -230 bytes and only half of it is in hotpath. Building the kernel with |
---|
| 53 | +Although, roughly, 8 KB code is added in total, page_alloc.o increase by |
---|
| 54 | +520 bytes and less than half of it is in hotpath. Building the kernel with |
---|
55 | 55 | page owner and turning it on if needed would be great option to debug |
---|
56 | 56 | kernel memory problem. |
---|
57 | 57 | |
---|
.. | .. |
---|
83 | 83 | 4) Analyze information from page owner:: |
---|
84 | 84 | |
---|
85 | 85 | cat /sys/kernel/debug/page_owner > page_owner_full.txt |
---|
86 | | - grep -v ^PFN page_owner_full.txt > page_owner.txt |
---|
87 | | - ./page_owner_sort page_owner.txt sorted_page_owner.txt |
---|
| 86 | + ./page_owner_sort page_owner_full.txt sorted_page_owner.txt |
---|
88 | 87 | |
---|
89 | 88 | See the result about who allocated each page |
---|
90 | 89 | in the ``sorted_page_owner.txt``. |
---|