From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98ACFC433DF for ; Mon, 29 Jun 2020 22:38:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5B045206C3 for ; Mon, 29 Jun 2020 22:38:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="mWdo4IhL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B045206C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DB36A8D0012; Mon, 29 Jun 2020 18:38:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D64BC8D000F; Mon, 29 Jun 2020 18:38:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C7A418D0012; Mon, 29 Jun 2020 18:38:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0246.hostedemail.com [216.40.44.246]) by kanga.kvack.org (Postfix) with ESMTP id B1D918D000F for ; Mon, 29 Jun 2020 18:38:18 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 5EE25180AD806 for ; Mon, 29 Jun 2020 22:38:18 +0000 (UTC) X-FDA: 76983714276.14.mark32_0512e7426e73 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id 2A30918012625 for ; Mon, 29 Jun 2020 22:38:16 +0000 (UTC) X-HE-Tag: mark32_0512e7426e73 X-Filterd-Recvd-Size: 5002 Received: from hqnvemgate26.nvidia.com (hqnvemgate26.nvidia.com [216.228.121.65]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Mon, 29 Jun 2020 22:38:15 +0000 (UTC) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 29 Jun 2020 15:38:01 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 29 Jun 2020 15:38:14 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 29 Jun 2020 15:38:14 -0700 Received: from [10.2.91.207] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 29 Jun 2020 22:38:14 +0000 Subject: Re: [PATCH 1/3] mm: Print head flags in dump_page To: "Matthew Wilcox (Oracle)" , , Andrew Morton CC: Vlastimil Babka References: <20200629151918.15537-1-willy@infradead.org> <20200629151918.15537-2-willy@infradead.org> From: John Hubbard Message-ID: Date: Mon, 29 Jun 2020 15:38:13 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200629151918.15537-2-willy@infradead.org> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1593470281; bh=YaZRIZjR8Ss14KmMlWhubNF+7JuM2MtUpzY3rVul62M=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=mWdo4IhLj0PowX7tap9Ybej624HeASAn9Oqfczk/ZhZw44IQvekb3VXsCFHaVoEwk iukYtoimB4X/dG6usk9UbjcvgmKXh0jMd5dxdKivdH7vl5ra735BywEKJKZIhCnpd+ 1kbtWMJBshQBgDIJzRGbRfeuj6ddykU5VpCUaFR6N5sf3ZKWmJ06+9h0MoY2MhZKT6 i4odsn7dbb5PZ5RtJ6x4Jhk9dyWE+vqwFblTW9nw8oz8XuXptXW3wmn83LqMHwroa7 Sjv1t5YjVIuSkkjeXvINUdk4JDMEN2rFVycZp76o8XoKILDCFeiCupDgzXSJAf15IY 8aeDn42/ft/Eg== X-Rspamd-Queue-Id: 2A30918012625 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 2020-06-29 08:19, Matthew Wilcox (Oracle) wrote: > Tail page flags contain very little useful information. Print the head > page's flags instead (even though PageHead is a little misleading). You are right about the tail page. And the raw output provides the tail page flags, in case someone *really* needs to dig into tail page problems, so that's all good. However, I just gave this a spin, and seeing the "|head" in the list for my "tail page: dump_page test" is also slightly misleading for me, too. Sure, one can eventually work through it and conclude "my dump_page output is misleading", but I think a small tweak would avoid that: > > Signed-off-by: Matthew Wilcox (Oracle) > --- > mm/debug.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/debug.c b/mm/debug.c > index 4f376514744d..44d843b3b07c 100644 > --- a/mm/debug.c > +++ b/mm/debug.c > @@ -163,7 +163,7 @@ void __dump_page(struct page *page, const char *reason) > out_mapping: > BUILD_BUG_ON(ARRAY_SIZE(pageflag_names) != __NR_PAGEFLAGS + 1); > > - pr_warn("%sflags: %#lx(%pGp)%s\n", type, page->flags, &page->flags, > + pr_warn("%sflags: %#lx(%pGp)%s\n", type, head->flags, &head->flags, > page_cma ? " CMA" : ""); Perhaps just adding "head " to the above will clear it all up: diff --git a/mm/debug.c b/mm/debug.c index fcf3a16902b2..b7ac8af71940 100644 --- a/mm/debug.c +++ b/mm/debug.c @@ -165,7 +165,7 @@ void __dump_page(struct page *page, const char *reason) out_mapping: BUILD_BUG_ON(ARRAY_SIZE(pageflag_names) != __NR_PAGEFLAGS + 1); - pr_warn("%sflags: %#lx(%pGp)%s\n", type, head->flags, &head->flags, + pr_warn("head %sflags: %#lx(%pGp)%s\n", type, head->flags, &head->flags, page_cma ? " CMA" : ""); hex_only: Sample output: [ 62.064271] page:000000001c8f0c3e refcount:513 mapcount:1 mapping:0000000000000000 index:0x11 head:00000000ba9ccef2 order:9 compound_mapcount:1 compound_pincount:512 [ 62.078432] head anon flags: 0x17ffe000001000e(referenced|uptodate|dirty|head) [ 62.088454] raw: 017ffe0000000000 ffffea00209e8001 ffffea00209e8448 dead000000000400 [ 62.095356] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 [ 62.102289] head: 017ffe000001000e ffffffff83649ca0 ffffea00209e0008 ffff88889663c001 [ 62.109286] head: 0000000000000000 0000000000000000 00000201ffffffff 0000000000000000 [ 62.116301] page dumped because: gup_benchmark: tail page: dump_page test thanks, -- John Hubbard NVIDIA