linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: linux-mm@kvack.org, Vlastimil Babka <vbabka@suse.cz>
Subject: Re: [PATCH] vsprintf: Make %pGp print the hex value
Date: Tue, 12 Oct 2021 12:11:30 +0100	[thread overview]
Message-ID: <YWVtYs7ge7IcLJtW@casper.infradead.org> (raw)
In-Reply-To: <1093c8db-5d96-18ff-cb27-e74cddb757a4@rasmusvillemoes.dk>

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) <willy@infradead.org>
> > ---
> >  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.


  reply	other threads:[~2021-10-12 11:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-08 19:38 Matthew Wilcox (Oracle)
2021-10-12  8:46 ` [vsprintf] 97265529aa: kernel-selftests.lib.printf.sh.fail kernel test robot
2021-10-12  9:55 ` [PATCH] vsprintf: Make %pGp print the hex value Rasmus Villemoes
2021-10-12 11:11   ` Matthew Wilcox [this message]
2021-10-12 11:32   ` Matthew Wilcox
2021-10-12 11:57     ` Rasmus Villemoes
2021-10-12 16:11       ` Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YWVtYs7ge7IcLJtW@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox