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.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 464FCC433DB for ; Mon, 1 Feb 2021 13:53:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9343064E97 for ; Mon, 1 Feb 2021 13:53:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9343064E97 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1281B6B006E; Mon, 1 Feb 2021 08:53:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0D94E6B0072; Mon, 1 Feb 2021 08:53:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F0A566B0075; Mon, 1 Feb 2021 08:53:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0107.hostedemail.com [216.40.44.107]) by kanga.kvack.org (Postfix) with ESMTP id D63226B006E for ; Mon, 1 Feb 2021 08:53:30 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A00378249980 for ; Mon, 1 Feb 2021 13:53:30 +0000 (UTC) X-FDA: 77769841380.17.sink11_0211f1d275c2 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 845ED180D0180 for ; Mon, 1 Feb 2021 13:53:30 +0000 (UTC) X-HE-Tag: sink11_0211f1d275c2 X-Filterd-Recvd-Size: 5190 Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Mon, 1 Feb 2021 13:53:30 +0000 (UTC) Received: by mail-il1-f172.google.com with SMTP id p8so15602493ilg.3 for ; Mon, 01 Feb 2021 05:53:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BeSu4xYQl+/zC1Ai3KoLiW3Kk/6+Mg+BlRaAWIf/mIo=; b=TKw0vFNs9522C1dd7Jccv26cVLax4gf7b5Pdi9MpFL5+U7BJd20VZZ4haBWYlmAk5R 6cPy4h+s0Bcj8kfLANlSYZEm92KeKHt6aV0W7TcpPXjVc4lya9EYECMQiamUMJOe011w 26IPjwmr+AwnbhvgJOysJCzrjIPYpvmiQfcj/mrEbIzd6kofGn9uImj58ERdKQW1ZnSc oi+voxs82uSkbAnq+yyUWAPUD4TdP5oS2IZVcP7WVgeBysn2Ouq8rhXyWEjMAC0jvVbh JNkQO+v9rdoOcV6IIumpPk060NsCkuYoUMPCukUzi5wohtCJdBxp0KaDzr1HQV1unwQA bMGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BeSu4xYQl+/zC1Ai3KoLiW3Kk/6+Mg+BlRaAWIf/mIo=; b=Oqe/Skpjxm/cZDKDt4SsqWtTVt02Sl8Ij9pvx9Ig/PpG6tROPig+5Iv3bpy2SGIxvE LdB6AmuCcuWohrrARYlREQ2z0506Mqfg3WCXOZiCQFG2YUKsZLB+WpbTmpFaWQbJbCvQ IdFjfo93fkoAutnnjE4NZezSw4Uog3QcH5xCd9YXyFaSxlUgFTKDfJXJwr22hqAw0K1/ fJU5A4k0Oycfw8j0LbNxZXCtCHtXRov6RhvlbzImDcJeoz64zPdzyd6oXMq4g/oFOsQf XQdzYv1LBOURwzOjjrv6IN48T5eGowkZhE0+AyoGDJ3Pwi2QTku9jLWXpL1R2bkedR3D U/KA== X-Gm-Message-State: AOAM533IK9SrSHTXqeROZvkWkNFddpnfFehSNQu/ajMcSmROOmR3SjFh 8AsEKzwuqzH1VrKhRI8uvzQbR4g/8Y9d+KLfVCs= X-Google-Smtp-Source: ABdhPJzXZ3YRSg+mtqXMCWCd7XfgB1X0ZqLiJkwKk0K4HjNAvNXZF87LEaKwmQDir/YWK6mGH91lams5hI2efWtmFUs= X-Received: by 2002:a05:6e02:b:: with SMTP id h11mr12729742ilr.168.1612187609633; Mon, 01 Feb 2021 05:53:29 -0800 (PST) MIME-Version: 1.0 References: <20210201115610.87808-1-laoar.shao@gmail.com> <20210201115610.87808-4-laoar.shao@gmail.com> <66784ea1-29c7-6bed-ca7f-cd3e7ea9155b@redhat.com> In-Reply-To: From: Yafang Shao Date: Mon, 1 Feb 2021 21:52:53 +0800 Message-ID: Subject: Re: [PATCH v2 3/3] vsprintf: dump full information of page flags in pGp To: Andy Shevchenko Cc: David Hildenbrand , Vlastimil Babka , Miaohe Lin , Christoph Lameter , penberg@kernel.org, David Rientjes , iamjoonsoo.kim@lge.com, Andrew Morton , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Rasmus Villemoes , Linux MM , LKML , Joe Perches Content-Type: text/plain; charset="UTF-8" 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 Mon, Feb 1, 2021 at 9:34 PM Andy Shevchenko wrote: > > On Mon, Feb 01, 2021 at 02:23:33PM +0100, David Hildenbrand wrote: > > On 01.02.21 12:56, Yafang Shao wrote: > > > Currently the pGp only shows the names of page flags, rather than > > > the full information including section, node, zone, last cpupid and > > > kasan tag. While it is not easy to parse these information manually > > > because there're so many flavors. Let's interpret them in pGp as well. > > > > > > - Before the patch, > > > [ 6343.396602] Slab 0x000000004382e02b objects=33 used=3 fp=0x000000009ae06ffc flags=0x17ffffc0010200(slab|head) > > > > > > - After the patch, > > > [ 6871.296131] Slab 0x00000000c0e19a37 objects=33 used=3 fp=0x00000000c4902159 flags=0x17ffffc0010200(Node 0,Zone 2,Lastcpupid 0x1fffff,slab|head) > > > > For debugging purposes, it might be helpful to have the actual zone name > > (and to know if the value is sane). You could obtain it (without other > > modifications) via > > > > const char zname = "Invalid"; > > > > if (zone < MAX_NR_ZONES) > > zname = first_online_pgdat()->node_zones[zone].name; > > > > > > Similarly, it might also be helpful to indicate if a node is > > online/offline/invalid/. > > > > const char nstate = "Invalid"; > > > > if (node_online(nid)) > > nstate = "Online"; > > else if (node_possible(nid)) > > nstate = "Offline"; > > > > > > Printing that in addition to the raw value could be helpful. Just some > > thoughts. > > printf() buffer is not a black hole, esp. when you get it messed with critical > messages (Oops). I suggest to reduce a burden as much as possible. If you wish > to get this, make it caller-configurable, i.e. adding another letter to the > specifier. > I think David's suggestion will help us to identify issues. You mean that we should use another one like "%pGpd" - means pGp debug - to implement it ? -- Thanks Yafang