linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Subject: Re: [PATCH] mm: dump_page: add debugfs file for dumping page state by pfn
Date: Mon, 25 May 2020 17:56:52 +0300	[thread overview]
Message-ID: <20200525145652.u3xnom5fyuxvn7p4@box> (raw)
In-Reply-To: <159041635119.987025.7321864888027213705.stgit@buzz>

On Mon, May 25, 2020 at 05:19:11PM +0300, Konstantin Khlebnikov wrote:
> Tool 'page-types' could list pages mapped by process or file cache pages,
> but it shows only limited amount of state exported via procfs.
> 
> Let's employ existing helper dump_page() to reach remaining information:
> writing pfn into /sys/kernel/debug/dump_page dumps state into kernel log.
> 
> # echo 0x37c43c > /sys/kernel/debug/dump_page
> # dmesg | tail -6
>  page:ffffcb0b0df10f00 refcount:1 mapcount:0 mapping:000000007755d3d9 index:0x30
>  0xffffffffae4239e0 name:"libGeoIP.so.1.6.9"
>  flags: 0x200000000020014(uptodate|lru|mappedtodisk)
>  raw: 0200000000020014 ffffcb0b187fd288 ffffcb0b189e6248 ffff9528a04afe10
>  raw: 0000000000000030 0000000000000000 00000001ffffffff 0000000000000000
>  page dumped because: debugfs request
> 
> With CONFIG_PAGE_OWNER=y shows also stacks for last page alloc and free:
> 
>  page:ffffea0018fff480 refcount:1 mapcount:1 mapping:0000000000000000 index:0x7f9f28f62
>  anon flags: 0x100000000080034(uptodate|lru|active|swapbacked)
>  raw: 0100000000080034 ffffea00184140c8 ffffea0018517d88 ffff8886076ba161
>  raw: 00000007f9f28f62 0000000000000000 0000000100000000 ffff888bfc79f000
>  page dumped because: debugfs request
>  page->mem_cgroup:ffff888bfc79f000
>  page_owner tracks the page as allocated
>  page last allocated via order 0, migratetype Movable, gfp_mask 0x100dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO)
>   prep_new_page+0x139/0x1a0
>   get_page_from_freelist+0xde9/0x14e0
>   __alloc_pages_nodemask+0x18b/0x360
>   alloc_pages_vma+0x7c/0x270
>   __handle_mm_fault+0xd40/0x12b0
>   handle_mm_fault+0xe7/0x1e0
>   do_page_fault+0x2d5/0x610
>   page_fault+0x2f/0x40
>  page last free stack trace:
>   free_pcp_prepare+0x11e/0x1c0
>   free_unref_page_list+0x71/0x180
>   release_pages+0x31e/0x480
>   tlb_flush_mmu+0x44/0x150
>   tlb_finish_mmu+0x3d/0x70
>   exit_mmap+0xdd/0x1a0
>   mmput+0x70/0x140
>   do_exit+0x33f/0xc40
>   do_group_exit+0x3a/0xa0
>   __x64_sys_exit_group+0x14/0x20
>   do_syscall_64+0x48/0x130
>   entry_SYSCALL_64_after_hwframe+0x44/0xa9
> 
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>

Looks useful to me:

Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

-- 
 Kirill A. Shutemov


  reply	other threads:[~2020-05-25 14:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-25 14:19 Konstantin Khlebnikov
2020-05-25 14:56 ` Kirill A. Shutemov [this message]
2020-05-25 15:33 ` Matthew Wilcox
2020-05-25 16:03   ` Konstantin Khlebnikov
2020-05-25 16:05     ` Konstantin Khlebnikov
2020-05-25 15:35 ` Vlastimil Babka
2020-05-25 15:58   ` Konstantin Khlebnikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200525145652.u3xnom5fyuxvn7p4@box \
    --to=kirill@shutemov.name \
    --cc=akpm@linux-foundation.org \
    --cc=khlebnikov@yandex-team.ru \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox