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=-1.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 0180DC433DF for ; Thu, 2 Jul 2020 15:53:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B841820771 for ; Thu, 2 Jul 2020 15:53:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="vzlKFvJ8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B841820771 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3AF936B00E0; Thu, 2 Jul 2020 11:53:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 361C06B00E2; Thu, 2 Jul 2020 11:53:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 250696B00E3; Thu, 2 Jul 2020 11:53:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0208.hostedemail.com [216.40.44.208]) by kanga.kvack.org (Postfix) with ESMTP id 0F9A66B00E0 for ; Thu, 2 Jul 2020 11:53:42 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id A0AE0180AD806 for ; Thu, 2 Jul 2020 15:53:41 +0000 (UTC) X-FDA: 76993581042.12.wood03_13012dd26e8a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id 7CD181800CFE6 for ; Thu, 2 Jul 2020 15:53:41 +0000 (UTC) X-HE-Tag: wood03_13012dd26e8a X-Filterd-Recvd-Size: 7592 Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Thu, 2 Jul 2020 15:53:40 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id h19so32852090ljg.13 for ; Thu, 02 Jul 2020 08:53:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=y16YK30RYWmOIB1Bx8KliS2oCBCIvoP23puwvApsGEY=; b=vzlKFvJ8fd5NtTA7n358Nx/obmFevapwCLiUcxX21X2WkRxKXhbknuxMKehrTOWnhI ADJICy3jRJ89jhL/G7Ep6ZqpGrJvDp5mx7TR/7WlzGSfTMZ0GHJAERl4NctueGOP6Unm U6kOZt7WTlIJN05PgV2+DzNJeMotzKoHeliV2277Cg2hfjgJoabXkdnohg/QG6/qhVMb KK79BrXLs6B46GejX3GRYx2H3p8V5tM1F8TNyTLPDF7FwZLzISHMvRBKVXhCUOqlYXg+ H2X05qTs1/6B5X1DtiDoG6Zm6XMtkpkbOEHdFNbeCDuJ4wg9IfM1AbYdSAflUj8BY3PV a4NA== 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; bh=y16YK30RYWmOIB1Bx8KliS2oCBCIvoP23puwvApsGEY=; b=aEnVj6scUPKVcergp/D8uGw1z2SaemHHFXqUMBN15tfecEzNACEHio46zJUfdFYamy 6hqUkwzLXlrBkoTNOWoT75+N9YNI6QQ0O7YUWm1jNPPO7izeGJEmaBuTrFWGaLbkMeST sSflP7AIOM8unb7uz7eqGeuDQlmYSZBOxINu3J7XlPwD/LOgiFbJaVQcSrhfLx5zt/AW d6tPreK5BKl0LjPmzrzjZm1WTWJSkVffxwJEwFVX7ys/HUFcAalGC6TIoEmye/YGJalj 3HDI9GbQFyhkXlpz7j/QvISsdG9Kfv8mfEUNrj/jhTGR7TQSci5e4x4X85eRaKvValFn jygg== X-Gm-Message-State: AOAM530BOlr1nI/VwpdMIYd1URDVYG6hnPllQBHjFUh5l0M2eC99WF9s 05283+bkM3G8q936Ped6nw7ZoA== X-Google-Smtp-Source: ABdhPJz7m1P3+nXtM1rbUYllzuIwW4E6LXtvX68yCAW5//cE6a1Xy9osGAxByEgU1fjUkFdDDuwAvQ== X-Received: by 2002:a2e:9bc4:: with SMTP id w4mr15086574ljj.391.1593705219348; Thu, 02 Jul 2020 08:53:39 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id n3sm2350719ljj.39.2020.07.02.08.53.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2020 08:53:38 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id E6BCF1018AB; Thu, 2 Jul 2020 18:53:36 +0300 (+03) Date: Thu, 2 Jul 2020 18:53:36 +0300 From: "Kirill A. Shutemov" To: Vlastimil Babka Cc: Matthew Wilcox , John Hubbard , linux-mm@kvack.org, Andrew Morton , "Kirill A. Shutemov" , Mike Kravetz Subject: Re: [PATCH 1/3] mm: Print head flags in dump_page Message-ID: <20200702155336.san26vjcasbnbswy@box> 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> <49e5da43-88bd-bac5-4dcc-5f5abb0d9a1b@suse.cz> <20200630115950.GM25523@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 7CD181800CFE6 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 Thu, Jul 02, 2020 at 04:59:14PM +0200, Vlastimil Babka wrote: > On 6/30/20 1:59 PM, Matthew Wilcox wrote: > > On Tue, Jun 30, 2020 at 10:02:50AM +0200, Vlastimil Babka wrote: > >> 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? > > > >> On 6/30/20 1:35 AM, John Hubbard wrote: > >> > ...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 > > > > index is the last thing printed on this line. If it's something like > > index:0x12345678, you can reduce it mod 1< > line. > > Hmm, I guess that works as long as head pages really have index aligned to 1 << > order ... they should, right? > > But does it fail for HugeTLB? CC Kirill (git blamed) and Mike. > page_to_pgoff() has for PageHeadHuge this: > return page->index << compound_order(page) > > but page_to_index() does simply > pgoff = compound_head(page)->index; > pgoff += page - compound_head(page); > > Shouldn't it also do a < > >> > [ 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) > > > > How about ... > > [ 38.049155] flags: 0x17ffe000000000e(anon|referenced|uptodate|dirty|compound) > > > > That is, change pageflag_names[] to print 'head' as 'compound' and move the > > 'anon' or 'ksm' to look like a pageflag. Also CMA. Like this: > > > > +++ b/include/trace/events/mmflags.h > > @@ -96,7 +96,7 @@ > > {1UL << PG_private, "private" }, \ > > {1UL << PG_private_2, "private_2" }, \ > > {1UL << PG_writeback, "writeback" }, \ > > - {1UL << PG_head, "head" }, \ > > + {1UL << PG_head, "compound" }, \ > > Dunno about this, "compound" used to always mean "head or tail" AFAIK. Yeah. I'm not convinced by the change either. show_page_flags() also uses this difinitions and I think it can get confusing in the trace. -- Kirill A. Shutemov