<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/scripts/gdb/linux/page_owner.py, branch v6.12.80</title>
<subtitle>Clone of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/'/>
<entry>
<title>scripts/gdb: remove exception handling and refine print format</title>
<updated>2023-12-11T01:21:49+00:00</updated>
<author>
<name>Kuan-Ying Lee</name>
<email>Kuan-Ying.Lee@mediatek.com</email>
</author>
<published>2023-11-27T07:04:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=e52ec6a2db2e01e6a8cdfbe4fee1f89f57cdf723'/>
<id>e52ec6a2db2e01e6a8cdfbe4fee1f89f57cdf723</id>
<content type='text'>
1. When we crash on a page, we want to check what happened on this
   page instead of skipping this page by try-except block.  Thus, removing
   the try-except block.

2. Remove redundant comma and print the task name properly.

Link: https://lkml.kernel.org/r/20231127070404.4192-4-Kuan-Ying.Lee@mediatek.com
Signed-off-by: Kuan-Ying Lee &lt;Kuan-Ying.Lee@mediatek.com&gt;
Cc: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Cc: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Cc: Chinwen Chang &lt;chinwen.chang@mediatek.com&gt;
Cc: Matthias Brugger &lt;matthias.bgg@gmail.com&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Qun-Wei Lin &lt;qun-wei.lin@mediatek.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. When we crash on a page, we want to check what happened on this
   page instead of skipping this page by try-except block.  Thus, removing
   the try-except block.

2. Remove redundant comma and print the task name properly.

Link: https://lkml.kernel.org/r/20231127070404.4192-4-Kuan-Ying.Lee@mediatek.com
Signed-off-by: Kuan-Ying Lee &lt;Kuan-Ying.Lee@mediatek.com&gt;
Cc: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Cc: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Cc: Chinwen Chang &lt;chinwen.chang@mediatek.com&gt;
Cc: Matthias Brugger &lt;matthias.bgg@gmail.com&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Qun-Wei Lin &lt;qun-wei.lin@mediatek.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scripts/gdb/page_owner: add page owner support</title>
<updated>2023-08-21T20:46:23+00:00</updated>
<author>
<name>Kuan-Ying Lee</name>
<email>Kuan-Ying.Lee@mediatek.com</email>
</author>
<published>2023-08-08T08:30:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=2f060190efcee2781b3ba7cb12a6876b6e024e2d'/>
<id>2f060190efcee2781b3ba7cb12a6876b6e024e2d</id>
<content type='text'>
This GDB script prints page owner information for user to analyze the
memory usage or memory corruption issue.

Example output from an aarch64 system:

(gdb) lx-dump-page-owner --pfn 655360
page_owner tracks the page as allocated
Page last allocated via order 0, gfp_mask: 0x8, pid: 1, tgid: 1 ("swapper/0\000\000\000\000\000\000"), ts 1295948880 ns, free_ts 1011852016 ns
PFN: 655360, Flags: 0x3fffc0000000000
   0xffff8000086ab964 &lt;post_alloc_hook+452&gt;:    ldp     x19, x20, [sp, #16]
   0xffff80000862e4e0 &lt;split_map_pages+344&gt;:    cbnz    w22, 0xffff80000862e57c &lt;split_map_pages+500&gt;
   0xffff8000086370c4 &lt;isolate_freepages_range+556&gt;:    mov     x0, x27
   0xffff8000086bc1cc &lt;alloc_contig_range+808&gt;: mov     x24, x0
   0xffff80000877d6d8 &lt;cma_alloc+772&gt;:  mov     w1, w0
   0xffff8000082c8d18 &lt;dma_alloc_from_contiguous+104&gt;:  ldr     x19, [sp, #16]
   0xffff8000082ce0e8 &lt;atomic_pool_expand+208&gt;: mov     x19, x0
   0xffff80000c1e41b4 &lt;__dma_atomic_pool_init+172&gt;:     Cannot access memory at address 0xffff80000c1e41b4
   0xffff80000c1e4298 &lt;dma_atomic_pool_init+92&gt;:        Cannot access memory at address 0xffff80000c1e4298
   0xffff8000080161d4 &lt;do_one_initcall+176&gt;:    mov     w21, w0
   0xffff80000c1c1b50 &lt;kernel_init_freeable+952&gt;:       Cannot access memory at address 0xffff80000c1c1b50
   0xffff80000acf87dc &lt;kernel_init+36&gt;: bl      0xffff8000081ab100 &lt;async_synchronize_full&gt;
   0xffff800008018d00 &lt;ret_from_fork+16&gt;:       mrs     x28, sp_el0
page last free stack trace:
   0xffff8000086a6e8c &lt;free_unref_page_prepare+796&gt;:    mov     w2, w23
   0xffff8000086aee1c &lt;free_unref_page+96&gt;:     tst     w0, #0xff
   0xffff8000086af3f8 &lt;__free_pages+292&gt;:       ldp     x19, x20, [sp, #16]
   0xffff80000c1f3214 &lt;init_cma_reserved_pageblock+220&gt;:        Cannot access memory at address 0xffff80000c1f3214
   0xffff80000c20363c &lt;cma_init_reserved_areas+1284&gt;:   Cannot access memory at address 0xffff80000c20363c
   0xffff8000080161d4 &lt;do_one_initcall+176&gt;:    mov     w21, w0
   0xffff80000c1c1b50 &lt;kernel_init_freeable+952&gt;:       Cannot access memory at address 0xffff80000c1c1b50
   0xffff80000acf87dc &lt;kernel_init+36&gt;: bl      0xffff8000081ab100 &lt;async_synchronize_full&gt;
   0xffff800008018d00 &lt;ret_from_fork+16&gt;:       mrs     x28, sp_el0

Link: https://lkml.kernel.org/r/20230808083020.22254-7-Kuan-Ying.Lee@mediatek.com
Signed-off-by: Kuan-Ying Lee &lt;Kuan-Ying.Lee@mediatek.com&gt;
Cc: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Cc: Chinwen Chang &lt;chinwen.chang@mediatek.com&gt;
Cc: Matthias Brugger &lt;matthias.bgg@gmail.com&gt;
Cc: Qun-Wei Lin &lt;qun-wei.lin@mediatek.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This GDB script prints page owner information for user to analyze the
memory usage or memory corruption issue.

Example output from an aarch64 system:

(gdb) lx-dump-page-owner --pfn 655360
page_owner tracks the page as allocated
Page last allocated via order 0, gfp_mask: 0x8, pid: 1, tgid: 1 ("swapper/0\000\000\000\000\000\000"), ts 1295948880 ns, free_ts 1011852016 ns
PFN: 655360, Flags: 0x3fffc0000000000
   0xffff8000086ab964 &lt;post_alloc_hook+452&gt;:    ldp     x19, x20, [sp, #16]
   0xffff80000862e4e0 &lt;split_map_pages+344&gt;:    cbnz    w22, 0xffff80000862e57c &lt;split_map_pages+500&gt;
   0xffff8000086370c4 &lt;isolate_freepages_range+556&gt;:    mov     x0, x27
   0xffff8000086bc1cc &lt;alloc_contig_range+808&gt;: mov     x24, x0
   0xffff80000877d6d8 &lt;cma_alloc+772&gt;:  mov     w1, w0
   0xffff8000082c8d18 &lt;dma_alloc_from_contiguous+104&gt;:  ldr     x19, [sp, #16]
   0xffff8000082ce0e8 &lt;atomic_pool_expand+208&gt;: mov     x19, x0
   0xffff80000c1e41b4 &lt;__dma_atomic_pool_init+172&gt;:     Cannot access memory at address 0xffff80000c1e41b4
   0xffff80000c1e4298 &lt;dma_atomic_pool_init+92&gt;:        Cannot access memory at address 0xffff80000c1e4298
   0xffff8000080161d4 &lt;do_one_initcall+176&gt;:    mov     w21, w0
   0xffff80000c1c1b50 &lt;kernel_init_freeable+952&gt;:       Cannot access memory at address 0xffff80000c1c1b50
   0xffff80000acf87dc &lt;kernel_init+36&gt;: bl      0xffff8000081ab100 &lt;async_synchronize_full&gt;
   0xffff800008018d00 &lt;ret_from_fork+16&gt;:       mrs     x28, sp_el0
page last free stack trace:
   0xffff8000086a6e8c &lt;free_unref_page_prepare+796&gt;:    mov     w2, w23
   0xffff8000086aee1c &lt;free_unref_page+96&gt;:     tst     w0, #0xff
   0xffff8000086af3f8 &lt;__free_pages+292&gt;:       ldp     x19, x20, [sp, #16]
   0xffff80000c1f3214 &lt;init_cma_reserved_pageblock+220&gt;:        Cannot access memory at address 0xffff80000c1f3214
   0xffff80000c20363c &lt;cma_init_reserved_areas+1284&gt;:   Cannot access memory at address 0xffff80000c20363c
   0xffff8000080161d4 &lt;do_one_initcall+176&gt;:    mov     w21, w0
   0xffff80000c1c1b50 &lt;kernel_init_freeable+952&gt;:       Cannot access memory at address 0xffff80000c1c1b50
   0xffff80000acf87dc &lt;kernel_init+36&gt;: bl      0xffff8000081ab100 &lt;async_synchronize_full&gt;
   0xffff800008018d00 &lt;ret_from_fork+16&gt;:       mrs     x28, sp_el0

Link: https://lkml.kernel.org/r/20230808083020.22254-7-Kuan-Ying.Lee@mediatek.com
Signed-off-by: Kuan-Ying Lee &lt;Kuan-Ying.Lee@mediatek.com&gt;
Cc: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Cc: Chinwen Chang &lt;chinwen.chang@mediatek.com&gt;
Cc: Matthias Brugger &lt;matthias.bgg@gmail.com&gt;
Cc: Qun-Wei Lin &lt;qun-wei.lin@mediatek.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
