From patchwork Sun Mar 14 08:37:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yafang Shao X-Patchwork-Id: 12137215 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=-8.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham 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 BBDD1C433DB for ; Sun, 14 Mar 2021 08:37:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 43F9864EC6 for ; Sun, 14 Mar 2021 08:37:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 43F9864EC6 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 8C51B6B0006; Sun, 14 Mar 2021 04:37:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 876006B006E; Sun, 14 Mar 2021 04:37:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A0946B0070; Sun, 14 Mar 2021 04:37:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0136.hostedemail.com [216.40.44.136]) by kanga.kvack.org (Postfix) with ESMTP id 4B5916B0006 for ; Sun, 14 Mar 2021 04:37:41 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id F0BCB6C36 for ; Sun, 14 Mar 2021 08:37:40 +0000 (UTC) X-FDA: 77917826280.15.3E7E869 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by imf14.hostedemail.com (Postfix) with ESMTP id 92C9EC0007CA for ; Sun, 14 Mar 2021 08:37:40 +0000 (UTC) Received: by mail-pl1-f176.google.com with SMTP id j6so13843369plx.6 for ; Sun, 14 Mar 2021 00:37:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=swgTZcyDxG5UXaW4eHWPXDYwsdLtPHRopFJD8lRPN3g=; b=ehStkWu2iBocAGjMZvirspZr25tGyAgTfO3RIo4e9bEDjvzze1klz5qeQIAyQydHMu VcX2j+SNwCZbtiY73rz23XfZA23Af3iFoDLKaPEbAe6PpSqBvGvGcFvNT1ZkeAOI7yZY vWlXnyr6v5yhxS2k24Chbp+gvZykLcqEpN/NJ6kLxrome+Juj1aTcc1P9yr7Ob/harHD hLrhRoIQJpQFGGlkJuaLiiTbOJN+PriIM5LBLbb/L7em4IppYrywr9ySXoaeOEwdKLNW Hl8AZEZqcr+75ENDMlV4yTXC2AlO9Am6poc2G2mlm+blB0aEzyNflEkC7Lx4rSivFRBN 82eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=swgTZcyDxG5UXaW4eHWPXDYwsdLtPHRopFJD8lRPN3g=; b=ZMZDJ7eZ3MMYAWsuBMh8Df88bV4pJNPQFhOxeoZXibsqxFeLFG8iRGVdg2BCcXfftQ v9qt7+iYOJTKQ4avd7RiHNt1dDodOjrYgLk56tc5X4GTNNKePkZm1aFpvTzG5Xgr0Isz cda8KN0rzlYdJ6Tlp2VJiQtF4kJc6o3L23xIbUv3PaXkYag2BgftPM3FW15uR0afCjij Q2PM42CPeEsnZhzyW5WGPL0fMIIw357JlKwx0eYyZNJKcd/Afg1GrzKUmhTS3wt8j3JG ieqGuMRdzPpt49iGyGcofNv+eHIAmlq2UQxBAmemTbYMdZjsviL/RjG99B/+8gNM3ymc OaMQ== X-Gm-Message-State: AOAM531TNxN8C3YQJ6SlcTaUbg3vtQyalRx0U7EWx2D6pseJ24pqjyP/ AJlqyAz8S+e3ycHCGsX7in0= X-Google-Smtp-Source: ABdhPJyrBRbmV5tblyah3oI71emRbVXLnQT6TJFHMwmHmR0/amEE0enBbutmHTEXSNrXcVaB7BWR9g== X-Received: by 2002:a17:90a:e00c:: with SMTP id u12mr6953165pjy.133.1615711059647; Sun, 14 Mar 2021 00:37:39 -0800 (PST) Received: from localhost.localdomain ([50.236.19.102]) by smtp.gmail.com with ESMTPSA id s28sm10462585pfd.155.2021.03.14.00.37.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Mar 2021 00:37:39 -0800 (PST) From: Yafang Shao To: pmladek@suse.com, willy@infradead.org, andriy.shevchenko@linux.intel.com, david@redhat.com, linmiaohe@huawei.com, vbabka@suse.cz, cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, rostedt@goodmis.org, sergey.senozhatsky@gmail.com, joe@perches.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, lkp@intel.com, Yafang Shao Subject: [PATCH v6 0/3] mm, vsprintf: dump full information of page flags in pGp Date: Sun, 14 Mar 2021 16:37:14 +0800 Message-Id: <20210314083717.96380-1-laoar.shao@gmail.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 92C9EC0007CA X-Stat-Signature: fxaqnffuue6g5w19jgt7w8ce5qgr197z Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf14; identity=mailfrom; envelope-from=""; helo=mail-pl1-f176.google.com; client-ip=209.85.214.176 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615711060-247886 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: The existed pGp shows the names of page flags only, rather than the full information including section, node, zone, last cpuipid and kasan tag. While it is not easy to parse these information manually because there are so many flavors. We'd better interpret them in printf. To be compitable with the existed format of pGp, the new introduced ones also use '|' as the separator, then the user tools parsing pGp won't need to make change, suggested by Matthew. The new added information is tracked onto the end of the existed one, e.g. [ 8838.835456] Slab 0x000000002828b78a objects=33 used=3 fp=0x00000000d04efc88 flags=0x17ffffc0010200(slab|head|node=0|zone=2|lastcpupid=0x1fffff) The documentation and test cases are also updated. The result of the test cases as follows, [68599.816764] test_printf: loaded. [68599.819068] test_printf: all 388 tests passed [68599.830367] test_printf: unloaded. This patchset also includes some code cleanup in mm/slub.c. v6: - fixes the build failure and test failure reported by kernel test robot v5: - remove the bitmap and better name the struct, per Petr v4: - extend %pGp instead of introducing new format, per Matthew v3: - coding improvement, per Joe and Andy - the possible impact on debugfs and the fix of it, per Joe and Matthew - introduce new format instead of changing pGp, per Andy v2: - various coding improvement, per Joe, Miaohe, Vlastimil and Andy - remove the prefix completely in patch #2, per Vlastimil - Update the test cases, per Andy Yafang Shao (3): mm, slub: use pGp to print page flags mm, slub: don't combine pr_err with INFO vsprintf: dump full information of page flags in pGp Documentation/core-api/printk-formats.rst | 2 +- lib/test_printf.c | 90 ++++++++++++++++++++--- lib/vsprintf.c | 66 +++++++++++++++-- mm/slub.c | 13 ++-- 4 files changed, 149 insertions(+), 22 deletions(-)