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=-7.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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 59F25C433DB for ; Mon, 1 Feb 2021 13:32:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 05F3464D99 for ; Mon, 1 Feb 2021 13:32:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05F3464D99 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 88B1C6B0078; Mon, 1 Feb 2021 08:32:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 83A9D6B007B; Mon, 1 Feb 2021 08:32:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 751106B007D; Mon, 1 Feb 2021 08:32:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0169.hostedemail.com [216.40.44.169]) by kanga.kvack.org (Postfix) with ESMTP id 5E61E6B0078 for ; Mon, 1 Feb 2021 08:32:27 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 15C093630 for ; Mon, 1 Feb 2021 13:32:27 +0000 (UTC) X-FDA: 77769788334.21.paint52_02031bc275c2 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id DBF92180442C3 for ; Mon, 1 Feb 2021 13:32:26 +0000 (UTC) X-HE-Tag: paint52_02031bc275c2 X-Filterd-Recvd-Size: 4171 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Mon, 1 Feb 2021 13:32:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612186345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I5KNMdkH+v6Gcyhmh6MX5JD5WTgQep8ALNRpHlvtT0Q=; b=EM3Eym+V2B6PrpC39NasC4qDMHNU9WHpF9nb4LgdQgijRdhx5Fdyms9a40y+VJ281gwWrZ /3FeVhMrsMy9ei53uj/Nk7z5iLJBPvCcFuPVzzSQ6SzIV8S7i3IebvnigiIrlPolPHkNbQ LeZAPLaQVLCNS+O4yonL5Q/Ceu91ngk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-173-lbne02fTM9CdQQCu0G93gQ-1; Mon, 01 Feb 2021 08:32:23 -0500 X-MC-Unique: lbne02fTM9CdQQCu0G93gQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 68338B811D; Mon, 1 Feb 2021 13:32:20 +0000 (UTC) Received: from [10.36.115.24] (ovpn-115-24.ams2.redhat.com [10.36.115.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id E05B55DA33; Mon, 1 Feb 2021 13:32:14 +0000 (UTC) Subject: Re: [PATCH v2 3/3] vsprintf: dump full information of page flags in pGp From: David Hildenbrand To: Yafang Shao , andriy.shevchenko@linux.intel.com, 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 Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Joe Perches References: <20210201115610.87808-1-laoar.shao@gmail.com> <20210201115610.87808-4-laoar.shao@gmail.com> <66784ea1-29c7-6bed-ca7f-cd3e7ea9155b@redhat.com> Organization: Red Hat GmbH Message-ID: Date: Mon, 1 Feb 2021 14:32:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <66784ea1-29c7-6bed-ca7f-cd3e7ea9155b@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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 01.02.21 14:23, 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"; Just remembering that we have to take care of nid limits: if (nid >= 0 && nid < MAX_NUMNODES) { if (node_online(nid)) nstate = "Online"; else if (node_possible(nid)) nstate = "Offline"; } -- Thanks, David / dhildenb