Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5223414ybl; Tue, 14 Jan 2020 05:38:02 -0800 (PST) X-Google-Smtp-Source: APXvYqznalFBRg9ulWtdn2xCDZDDFRMCzVcRSPaAlNjrkmAslMsyUHeXToivrsgMiHW9oRrG4X9T X-Received: by 2002:aca:edc5:: with SMTP id l188mr15770566oih.55.1579009082417; Tue, 14 Jan 2020 05:38:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579009082; cv=none; d=google.com; s=arc-20160816; b=S/1wLLLsfOQOtlcKty85nnqypB/e5rQXgMzIsL3zvGmtVbmoacG/n6HNfFBtDh0WRu yKHbHKXjzKISSJx7ZJe/I8sahE7w86/YPWDxbL5YwtnXnAVAF+OioulfKNRW5jftIwyu 2QvaObPENn/h7ctDpExkTvc/bn8gOSC+yk89QCbDG/fUcuN/+YSrBUvjw142djqL1tgE hD3iBEa+LpbjS7/FSP2ExiM6aAZ6km7EkwJtmY9d89wYZG9eGay/ptTa1EFZO0uOT6P3 cI4HRsCOnSg8e44gVIQWvjQn1XvFq5jHmpAoMwsDrg2BSjCjOp3qofaf5i+N7//aLtpi QZ3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=K8VqjYHbpabchJbxExbEKyshv65LeYUyVLG0yJ6Bwpk=; b=FUCUKJF2zVb/aORmUSqXTKgLyrzM8UYaK22piIQzWTx9fDJSC7lCWmqqrt+Wb2HsDa 1EtkgOjFq4Vj8QRLh95+ssPnSGLqj6/Rg6IGQg5FM3nrbIEUVfnmji6LCIBkn4B6Lzp9 6nHY9byGbIUyLOUcd6aho5kC0SetBKNx/X4M5grUAdkG99EUswIUWgQdC3qKiIW+HLKe eJb+5teNGD3iXQLinSBto7gO7R6G8V2CJDyQx1hxH5YTxJ8kJSqqryT3lGEeKt3NaWax 34b5Snb7Uf7PKBsdJLgu9KeAmpOUbfdgdiGT2rFDuji9zrsck4ruz8bLMUN5sh/rbxUh Wd5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si8491305otq.96.2020.01.14.05.37.50; Tue, 14 Jan 2020 05:38:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728767AbgANNfY (ORCPT + 99 others); Tue, 14 Jan 2020 08:35:24 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:55554 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726038AbgANNfY (ORCPT ); Tue, 14 Jan 2020 08:35:24 -0500 Received: by mail-wm1-f67.google.com with SMTP id q9so13794565wmj.5 for ; Tue, 14 Jan 2020 05:35:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=K8VqjYHbpabchJbxExbEKyshv65LeYUyVLG0yJ6Bwpk=; b=JGHhoNu/1mNs9zXCdvmDtgT1jrAuyvWlU8y2R1neGeFOtaJGEn+453LRW1WxypwQ0A qi4y2A9fIu4rYuo/syP2i8rYeCZU9HBrBirEmPcHHZoXiplQ1pekv7NaJyuiQKSFHbdr gqX6+a0VgMI6RGJF+gXgpEwhBylgoOG4A6XgrlZd2QNdExpwN/kV+ZkGuyZIPOpWcJJw cZRazgINlzgLc34ooTyFrvwaUBFnNOdev4wKhCYYLbVFVWx9nTgtPQ08ulNTzomQUyGl 1gLcVwJk1t1JW+6zCCJQ7TCpEAJ/aQjBaA9PhSQHi3VQBHeYcgecqfKIs99spu2j4ahV auyA== X-Gm-Message-State: APjAAAXwVZbFewQ6pV4hLu0OPbKHSVBho+fQDabSC3m7p42L2liRi27G yztSJUwCf2kbGeAJOwC/1sk= X-Received: by 2002:a1c:1b41:: with SMTP id b62mr26493328wmb.53.1579008921620; Tue, 14 Jan 2020 05:35:21 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id m126sm19116112wmf.7.2020.01.14.05.35.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2020 05:35:20 -0800 (PST) Date: Tue, 14 Jan 2020 14:35:20 +0100 From: Michal Hocko To: Vlastimil Babka Cc: linux-mm@kvack.org, Andrew Morton , Anshuman Khandual , David Hildenbrand , Qian Cai , Oscar Salvador , Mel Gorman , Mike Rapoport , Dan Williams , Pavel Tatashin , linux-kernel@vger.kernel.org, Ralph Campbell Subject: Re: [PATCH] mm, debug: always print flags in dump_page() Message-ID: <20200114133520.GO19428@dhcp22.suse.cz> References: <49fa7dea-00ac-155f-e7b7-eeca206556b5@arm.com> <6A58E80B-7A5F-4CAD-ACF1-89BCCBE4D3B1@lca.pw> <20200114091013.GD19428@dhcp22.suse.cz> <1f3ff7fc-2f6b-d8e5-85a5-078f0e1a0daf@suse.cz> <20200114113230.GM19428@dhcp22.suse.cz> <9f884d5c-ca60-dc7b-219c-c081c755fab6@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9f884d5c-ca60-dc7b-219c-c081c755fab6@suse.cz> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 14-01-20 13:04:31, Vlastimil Babka wrote: [...] > >From 7b673c45bc16526586ae8ea6fba416a547baa04e Mon Sep 17 00:00:00 2001 > From: Vlastimil Babka > Date: Tue, 14 Jan 2020 12:52:48 +0100 > Subject: [PATCH] mm, debug: always print flags in dump_page() > > Commit 76a1850e4572 ("mm/debug.c: __dump_page() prints an extra line") > inadvertently removed printing of page flags for pages that are neither > anon nor ksm nor have a mapping. Fix that. > > Using pr_cont() again would be a solution, but the commit explicitly removed > its use. Avoiding the danger of mixing up split lines from multiple CPUs might > be beneficial for near-panic dumps like this, so fix this without reintroducing > pr_cont(). > > Reported-by: Anshuman Khandual > Reported-by: Michal Hocko > Fixes: 76a1850e4572 ("mm/debug.c: __dump_page() prints an extra line") > Signed-off-by: Vlastimil Babka Acked-by: Michal Hocko Thanks! > --- > mm/debug.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/mm/debug.c b/mm/debug.c > index 0461df1207cb..6a52316af839 100644 > --- a/mm/debug.c > +++ b/mm/debug.c > @@ -47,6 +47,7 @@ void __dump_page(struct page *page, const char *reason) > struct address_space *mapping; > bool page_poisoned = PagePoisoned(page); > int mapcount; > + char *type = ""; > > /* > * If struct page is poisoned don't access Page*() functions as that > @@ -78,9 +79,9 @@ void __dump_page(struct page *page, const char *reason) > page, page_ref_count(page), mapcount, > page->mapping, page_to_pgoff(page)); > if (PageKsm(page)) > - pr_warn("ksm flags: %#lx(%pGp)\n", page->flags, &page->flags); > + type = "ksm "; > else if (PageAnon(page)) > - pr_warn("anon flags: %#lx(%pGp)\n", page->flags, &page->flags); > + type = "anon "; > else if (mapping) { > if (mapping->host && mapping->host->i_dentry.first) { > struct dentry *dentry; > @@ -88,10 +89,11 @@ void __dump_page(struct page *page, const char *reason) > pr_warn("%ps name:\"%pd\"\n", mapping->a_ops, dentry); > } else > pr_warn("%ps\n", mapping->a_ops); > - pr_warn("flags: %#lx(%pGp)\n", page->flags, &page->flags); > } > BUILD_BUG_ON(ARRAY_SIZE(pageflag_names) != __NR_PAGEFLAGS + 1); > > + pr_warn("%sflags: %#lx(%pGp)\n", type, page->flags, &page->flags); > + > hex_only: > print_hex_dump(KERN_WARNING, "raw: ", DUMP_PREFIX_NONE, 32, > sizeof(unsigned long), page, > -- > 2.24.1 -- Michal Hocko SUSE Labs