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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 75671C433DB for ; Mon, 1 Feb 2021 13:34:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E6C6464E8F for ; Mon, 1 Feb 2021 13:34:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6C6464E8F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 700416B007E; Mon, 1 Feb 2021 08:34:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 687F36B0080; Mon, 1 Feb 2021 08:34:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 502186B0081; Mon, 1 Feb 2021 08:34:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0226.hostedemail.com [216.40.44.226]) by kanga.kvack.org (Postfix) with ESMTP id 350496B007E for ; Mon, 1 Feb 2021 08:34:31 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id F07573630 for ; Mon, 1 Feb 2021 13:34:30 +0000 (UTC) X-FDA: 77769793500.14.scent10_5b073d4275c2 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id D254F18229835 for ; Mon, 1 Feb 2021 13:34:30 +0000 (UTC) X-HE-Tag: scent10_5b073d4275c2 X-Filterd-Recvd-Size: 3823 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Mon, 1 Feb 2021 13:34:30 +0000 (UTC) IronPort-SDR: 8xObzg0PxhUqKGgI4B8rHWzt0JioCs2T4J6yBNhA8eQWSsoymzTtfDu9OFLs/q2sRTKna/t1t0 /QXc4t6nv/3g== X-IronPort-AV: E=McAfee;i="6000,8403,9881"; a="180828153" X-IronPort-AV: E=Sophos;i="5.79,392,1602572400"; d="scan'208";a="180828153" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 05:34:28 -0800 IronPort-SDR: 7djqYBFT3il0+5o73I1DkiNMCL9mRxWwzYfvtp+L+rWTzPtSOwN1RGmFCE2ABLoJTvQDOvbf4u aOy+YKM+anfg== X-IronPort-AV: E=Sophos;i="5.79,392,1602572400"; d="scan'208";a="353990774" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 05:34:24 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1l6ZLP-0018pC-N0; Mon, 01 Feb 2021 15:34:19 +0200 Date: Mon, 1 Feb 2021 15:34:19 +0200 From: Andy Shevchenko To: David Hildenbrand Cc: Yafang Shao , vbabka@suse.cz, linmiaohe@huawei.com, cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, pmladek@suse.com, rostedt@goodmis.org, sergey.senozhatsky@gmail.com, linux@rasmusvillemoes.dk, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Joe Perches Subject: Re: [PATCH v2 3/3] vsprintf: dump full information of page flags in pGp Message-ID: References: <20210201115610.87808-1-laoar.shao@gmail.com> <20210201115610.87808-4-laoar.shao@gmail.com> <66784ea1-29c7-6bed-ca7f-cd3e7ea9155b@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <66784ea1-29c7-6bed-ca7f-cd3e7ea9155b@redhat.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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 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. -- With Best Regards, Andy Shevchenko