From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f71.google.com (mail-pg0-f71.google.com [74.125.83.71]) by kanga.kvack.org (Postfix) with ESMTP id 373BE6B0253 for ; Fri, 25 Nov 2016 11:02:46 -0500 (EST) Received: by mail-pg0-f71.google.com with SMTP id e9so177527669pgc.5 for ; Fri, 25 Nov 2016 08:02:46 -0800 (PST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10115.outbound.protection.outlook.com. [40.107.1.115]) by mx.google.com with ESMTPS id k5si45239185pgn.247.2016.11.25.08.02.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Nov 2016 08:02:45 -0800 (PST) Subject: Re: mm: BUG in pgtable_pmd_page_dtor References: <296bdd6b-5c9e-0fbc-8aa1-4e95d0aff031@suse.cz> <2ff6eee6-8828-821a-7dde-c2f68da697a5@suse.cz> <20161125130757.GC3439@node.shutemov.name> <2ff83214-70fe-741e-bf05-fe4a4073ec3e@suse.cz> From: Andrey Ryabinin Message-ID: Date: Fri, 25 Nov 2016 19:03:06 +0300 MIME-Version: 1.0 In-Reply-To: <2ff83214-70fe-741e-bf05-fe4a4073ec3e@suse.cz> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Vlastimil Babka Cc: "Kirill A. Shutemov" , Dmitry Vyukov , Andrew Morton , "Kirill A. Shutemov" , Michal Hocko , Ingo Molnar , Joonsoo Kim , "linux-mm@kvack.org" , LKML , syzkaller On 11/25/2016 05:08 PM, 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 > 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 Acked-by: Andrey Ryabinin -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org