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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 B5B59C433DF for ; Tue, 30 Jun 2020 08:02:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5F11C2067D for ; Tue, 30 Jun 2020 08:02:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F11C2067D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BF5D78D0008; Tue, 30 Jun 2020 04:02:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BA4A98D0007; Tue, 30 Jun 2020 04:02:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A94028D0008; Tue, 30 Jun 2020 04:02:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0039.hostedemail.com [216.40.44.39]) by kanga.kvack.org (Postfix) with ESMTP id 79C408D0007 for ; Tue, 30 Jun 2020 04:02:53 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 26173824556B for ; Tue, 30 Jun 2020 08:02:53 +0000 (UTC) X-FDA: 76985137026.13.rat07_3b17f2926e76 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 0171518140B67 for ; Tue, 30 Jun 2020 08:02:52 +0000 (UTC) X-HE-Tag: rat07_3b17f2926e76 X-Filterd-Recvd-Size: 3673 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Tue, 30 Jun 2020 08:02:52 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 79990AAC3; Tue, 30 Jun 2020 08:02:50 +0000 (UTC) Subject: Re: [PATCH 1/3] mm: Print head flags in dump_page To: John Hubbard , Matthew Wilcox Cc: linux-mm@kvack.org, Andrew Morton References: <20200629151918.15537-1-willy@infradead.org> <20200629151918.15537-2-willy@infradead.org> <20200629225134.GL25523@casper.infradead.org> <29baf5ca-1187-e00a-ee5c-5f08f7b69683@nvidia.com> From: Vlastimil Babka Message-ID: <49e5da43-88bd-bac5-4dcc-5f5abb0d9a1b@suse.cz> Date: Tue, 30 Jun 2020 10:02:50 +0200 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: <29baf5ca-1187-e00a-ee5c-5f08f7b69683@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0171518140B67 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000003, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 6/30/20 1:35 AM, John Hubbard wrote: >> + pr_warn("%sflags: %#lx(%pGp)%s\n", type, flags, &flags, >> page_cma ? " CMA" : ""); >> >> hex_only: >> > > ...so with that fix, along with your line break approach in the other thread, > a tail page dump of a FOLL_PIN page looks like this: > > [ 38.027987] page:00000000abaef9ae refcount:513 mapcount:1 mapping:0000000000000000 index:0x11 > [ 38.035633] head:00000000675be53c order:9 compound_mapcount:1 compound_pincount:512 > [ 38.049155] anon flags: 0x17ffe000000000e(referenced|uptodate|dirty) > [ 38.055465] raw: 017ffe0000000000 ffffea0020dd0001 ffffea0020dd0448 dead000000000400 > [ 38.062319] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 > [ 38.069183] head: 017ffe000001000e ffffffff83649ca0 ffffea0020dd8008 ffff88888e0b6641 > [ 38.076141] head: 0000000000000000 0000000000000000 00000201ffffffff 0000000000000000 > [ 38.083102] page dumped because: gup_benchmark: tail page: dump_page test > > So, good. However, I feel that the "head " prefix approach is slightly > preferable, because it's doing less processing (the more code one > adds to little-exercised debug paths, the more likely the debugging has > bugs) and is instead just printing out what it sees directly. And it seems a little > odd to remove the PG_head bit from the output. > > The "head " prefix approach looks like this: I would also prefer this approach.It would be also nice to know the tail index. As long as page pointer wasn't hashed, it was possible to figure this out, but now it's not. Maybe print pfn of both page and head? > [ 38.027987] page:00000000abaef9ae refcount:513 mapcount:1 mapping:0000000000000000 index:0x11 > [ 38.035633] head:00000000675be53c order:9 compound_mapcount:1 compound_pincount:512 > [ 38.049155] head anon flags: 0x17ffe000000000e(referenced|uptodate|dirty|head) > [ 38.055465] raw: 017ffe0000000000 ffffea0020dd0001 ffffea0020dd0448 dead000000000400 > [ 38.062319] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 > [ 38.069183] head: 017ffe000001000e ffffffff83649ca0 ffffea0020dd8008 ffff88888e0b6641 > [ 38.076141] head: 0000000000000000 0000000000000000 00000201ffffffff 0000000000000000 > [ 38.083102] page dumped because: gup_benchmark: tail page: dump_page test > > > > > thanks, >