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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A969C433EF for ; Tue, 12 Oct 2021 11:12:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AF77260524 for ; Tue, 12 Oct 2021 11:12:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AF77260524 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 47E39900002; Tue, 12 Oct 2021 07:12:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 42E1A6B0071; Tue, 12 Oct 2021 07:12:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 31BCB900002; Tue, 12 Oct 2021 07:12:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0163.hostedemail.com [216.40.44.163]) by kanga.kvack.org (Postfix) with ESMTP id 1B5A76B006C for ; Tue, 12 Oct 2021 07:12:35 -0400 (EDT) Received: from smtpin39.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id B9DD22AF09 for ; Tue, 12 Oct 2021 11:12:34 +0000 (UTC) X-FDA: 78687522228.39.3BFEAA5 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf23.hostedemail.com (Postfix) with ESMTP id 68C0A90000AC for ; Tue, 12 Oct 2021 11:12:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=p4lTCjWEW3dnfJra+4gFFrM3ZJIEL9fNJptGx/5Dj8s=; b=kmdfFyDBS+K6WW6v+Godpxtvw7 1IGPLNYaflFDtu5AUFvAYUaanuvUOj5277mB0Ir6oXRwHrsUAETinC0twsccHjsyYnB7f1pcL9Nrx Efy1SKYu2eADuSrRVBy5b9Vavg20O+mpnYEiCPU0WIRLc7G1I8zVovN4Id+IUwBplRAvA7a5WCZj4 xiRbB5W9T6ECAUlOz3YdK95/eKVDIXBWpTfYuF1916vs9gxlV3shv6lBx/LayCc/akNr5HcsnHFa/ vFnggkxCxO2ibbX6I8qfO/hvg/f5QctKlkKBVt/su9TlIKmfm6JBmW4SjFIxJc9lHLGHobZt74QcV lFt0SioA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1maFgw-006RMr-Um; Tue, 12 Oct 2021 11:11:52 +0000 Date: Tue, 12 Oct 2021 12:11:30 +0100 From: Matthew Wilcox To: Rasmus Villemoes Cc: linux-mm@kvack.org, Vlastimil Babka Subject: Re: [PATCH] vsprintf: Make %pGp print the hex value Message-ID: References: <20211008193829.849532-1-willy@infradead.org> <1093c8db-5d96-18ff-cb27-e74cddb757a4@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1093c8db-5d96-18ff-cb27-e74cddb757a4@rasmusvillemoes.dk> X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 68C0A90000AC X-Stat-Signature: 3hfuwpptyr7pdja5t4neygsoknby7dtp Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=kmdfFyDB; spf=none (imf23.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-HE-Tag: 1634037153-693949 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 Tue, Oct 12, 2021 at 11:55:50AM +0200, Rasmus Villemoes wrote: > On 08/10/2021 21.38, Matthew Wilcox (Oracle) wrote: > > All existing users of %pGp want the hex value as well as the decoded > > flag names. This looks awkward (passing the same parameter to printf > > twice), so move that functionality into the core. If we want, we > > can make that optional with flag arguments to %pGp in the future. > > > > Signed-off-by: Matthew Wilcox (Oracle) > > --- > > lib/test_printf.c | 2 ++ > > lib/vsprintf.c | 8 ++++++++ > > mm/debug.c | 2 +- > > mm/memory-failure.c | 8 ++++---- > > mm/page_owner.c | 4 ++-- > > mm/slub.c | 4 ++-- > > 6 files changed, 19 insertions(+), 9 deletions(-) > > > > diff --git a/lib/test_printf.c b/lib/test_printf.c > > index 55082432f37e..32d748d1ae02 100644 > > --- a/lib/test_printf.c > > +++ b/lib/test_printf.c > > @@ -614,6 +614,7 @@ page_flags_test(int section, int node, int zone, int last_cpupid, > > bool append = false; > > int i; > > > > + snprintf(cmp_buf + size, BUF_SIZE - size, "%x(", flags); > > This generates the hex value without leading 0x, however... > > > + buf = number(buf, end, flags, default_flag_spec); > > ...default_flag_spec has '.flags = SPECIAL | SMALL,', i.e. what one > would get from %#x . I'm guessing that's what upsets 0-day. > > Geez it would be nice if 0day actually reported the "Expected foo, but > bar was emitted to the buffer". Wait, I built a kernel with TEST_PRINTF and booted it. That doesn't run the tests at boot time? Sure would be nice if the Kconfig help text said what you had to do to actually run the self-test.