Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1530282

Re: mm: BUG in pgtable_pmd_page_dtor

From "Kirill A. Shutemov" <kirill@shutemov.name>
Newsgroups linux.kernel
Subject Re: mm: BUG in pgtable_pmd_page_dtor
Date 2016-11-25 15:40 +0100
Message-ID <sHpPr-1LD-5@gated-at.bofh.it> (permalink)
References (3 earlier) <sHkmK-6J9-15@gated-at.bofh.it> <sHoqm-YR-37@gated-at.bofh.it> <sHoqm-YR-35@gated-at.bofh.it> <sHoJH-15u-1@gated-at.bofh.it> <sHpmr-1yD-49@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Nov 25, 2016 at 03:08:10PM +0100, Vlastimil Babka wrote:
> On 11/25/2016 02:07 PM, Kirill A. Shutemov wrote:
> >> --- a/mm/debug.c
> >> +++ b/mm/debug.c
> >> @@ -59,6 +59,10 @@ void __dump_page(struct page *page, const char *reason)
> >>  
> >>  	pr_emerg("flags: %#lx(%pGp)\n", page->flags, &page->flags);
> >>  
> >> +	print_hex_dump(KERN_ALERT, "raw: ", DUMP_PREFIX_NONE,
> >> +			32, (sizeof(unsigned long) == 8) ? 8 : 4,
> > 
> > That's a very fancy way to write sizeof(unsigned long) ;)
>  
> Ah, damnit, thanks.
> 
> ----8<----
> From 08d2ee803567c13e3de7ce7e19338fe5286cc6b8 Mon Sep 17 00:00:00 2001
> From: Vlastimil Babka <vbabka@suse.cz>
> Date: Fri, 25 Nov 2016 09:08:05 +0100
> Subject: [PATCH v3] mm, debug: print raw struct page data in __dump_page()
> 
> The __dump_page() function is used when a page metadata inconsistency is
> detected, either by standard runtime checks, or extra checks in CONFIG_DEBUG_VM
> builds. It prints some of the relevant metadata, but not the whole struct page,
> which is based on unions and interpretation is dependent on the context.
> 
> This means that sometimes e.g. a VM_BUG_ON_PAGE() checks certain field, which
> is however not printed by __dump_page() and the resulting bug report may then
> lack clues that could help in determining the root cause. This patch solves
> the problem by simply printing the whole struct page word by word, so no part
> is missing, but the interpretation of the data is left to developers. This is
> similar to e.g. x86_64 raw stack dumps.
> 
> Example output:
> 
>  page:ffffea00000475c0 count:1 mapcount:0 mapping:          (null) index:0x0
>  flags: 0x100000000000400(reserved)
>  raw: 0100000000000400 0000000000000000 0000000000000000 00000001ffffffff
>  raw: ffffea00000475e0 ffffea00000475e0 0000000000000000 0000000000000000
>  page dumped because: VM_BUG_ON_PAGE(1)
> 
> [aryabinin@virtuozzo.com: suggested print_hex_dump()]
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

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

-- 
 Kirill A. Shutemov

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

mm: BUG in pgtable_pmd_page_dtor Dmitry Vyukov <dvyukov@google.com> - 2016-11-18 11:20 +0100
  Re: mm: BUG in pgtable_pmd_page_dtor "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-11-18 12:00 +0100
  Re: mm: BUG in pgtable_pmd_page_dtor Vlastimil Babka <vbabka@suse.cz> - 2016-11-24 15:00 +0100
    Re: mm: BUG in pgtable_pmd_page_dtor Dmitry Vyukov <dvyukov@google.com> - 2016-11-24 15:30 +0100
      Re: mm: BUG in pgtable_pmd_page_dtor Vlastimil Babka <vbabka@suse.cz> - 2016-11-25 09:50 +0100
        Re: mm: BUG in pgtable_pmd_page_dtor "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-11-25 11:50 +0100
        Re: mm: BUG in pgtable_pmd_page_dtor Vlastimil Babka <vbabka@suse.cz> - 2016-11-25 14:10 +0100
          Re: mm: BUG in pgtable_pmd_page_dtor "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-11-25 14:30 +0100
            Re: mm: BUG in pgtable_pmd_page_dtor Vlastimil Babka <vbabka@suse.cz> - 2016-11-25 15:10 +0100
              Re: mm: BUG in pgtable_pmd_page_dtor "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-11-25 15:40 +0100

csiph-web