All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Willy Tarreau <w@1wt.eu>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests/nolibc: add 7 tests for memcmp()
Date: Fri, 21 Oct 2022 10:07:38 -0700	[thread overview]
Message-ID: <20221021170738.GM5600@paulmck-ThinkPad-P17-Gen-1> (raw)
In-Reply-To: <20221021170134.GB8420@1wt.eu>

On Fri, Oct 21, 2022 at 07:01:34PM +0200, Willy Tarreau wrote:
> On Fri, Oct 21, 2022 at 08:56:45AM -0700, Paul E. McKenney wrote:
> > On Fri, Oct 21, 2022 at 08:03:40AM +0200, Willy Tarreau wrote:
> > > This adds 7 combinations of input values for memcmp() using signed and
> > > unsigned bytes, which will trigger on the original code before Rasmus'
> > > fix. This is mostly aimed at helping backporters verify their work, and
> > > showing how tests for corner cases can be added to the selftests suite.
> > > 
> > > Before the fix it reports:
> > >   12 memcmp_20_20 = 0                      [OK]
> > >   13 memcmp_20_60 = -64                    [OK]
> > >   14 memcmp_60_20 = 64                     [OK]
> > >   15 memcmp_20_e0 = 64                    [FAIL]
> > >   16 memcmp_e0_20 = -64                   [FAIL]
> > >   17 memcmp_80_e0 = -96                    [OK]
> > >   18 memcmp_e0_80 = 96                     [OK]
> > > 
> > > And after:
> > >   12 memcmp_20_20 = 0                      [OK]
> > >   13 memcmp_20_60 = -64                    [OK]
> > >   14 memcmp_60_20 = 64                     [OK]
> > >   15 memcmp_20_e0 = -192                   [OK]
> > >   16 memcmp_e0_20 = 192                    [OK]
> > >   17 memcmp_80_e0 = -96                    [OK]
> > >   18 memcmp_e0_80 = 96                     [OK]
> > > 
> > > Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> > > Signed-off-by: Willy Tarreau <w@1wt.eu>
> > 
> > I have pulled both of these in, thank you!
>  
> Thanks!
> 
> > One thing, though...  I had to do "make clean" in both tools/include/nolibc
> > and tools/testing/selftests/nolibc to make those two "[FAIL]" indications
> > go away.  Does this mean that I am doing something wrong?
> 
> No you didn't do anything wrong, it was the same for me and initially it
> was intentional, but probably it wasn't that good an idea. What happens
> is that we first prepare a pseudo-sysroot with kernel headers and nolibc
> headers, then we build the test based on this sysroot. Thus if any uapi
> header or nolibc header changes, nothing is detected. And I'm not much
> willing to always reinstall everything for every single test, nor to
> detect long dependency chains. Maybe I should think about adding another
> target to clean+test at the same time, or maybe make the current
> "nolibc-test" target do that and have a "retest" to only rebuild. But
> that needs to be thought about with the QEMU test as well (because most
> of the time for a quick test I don't build the kernel nor start QEMU, I
> just call the executable directly).
> 
> Any ideas or suggestions are welcome, of course. We could consider that
> if we build a kernel and start QEMU, it's long enough to justify a
> systematic clean maybe ?
> 
> > It would be good to know before I send the pull request containing these,
> > so that we can let Linus know of anything special he needs to do to
> > ensure a valid test result.
> 
> I see. In the worst case, a preliminary "make clean" will do it. We just
> need to decide what's the best solution for everyone (i.e. not waste too
> much time between tests while not getting misleading results by accident).

Maybe just document the careful/slow way, then people doing it more
frequently can do it the clever/fast way.

My guess is that the careful/slow is this:

	pushd tools/include/nolibc
	make clean
	make
	popd
	pushd tools/testing/selftests/nolibc
	make clean
	make -j32 run

Or did I miss a turn in there somewhere?

							Thanx, Paul

  reply	other threads:[~2022-10-21 17:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21  6:03 [PATCH] selftests/nolibc: add 7 tests for memcmp() Willy Tarreau
2022-10-21 15:56 ` Paul E. McKenney
2022-10-21 17:01   ` Willy Tarreau
2022-10-21 17:07     ` Paul E. McKenney [this message]
2022-10-21 17:20       ` Willy Tarreau
2022-10-21 18:00         ` Paul E. McKenney
2022-10-22 11:22           ` Willy Tarreau
2022-10-24 15:53             ` Paul E. McKenney
2022-10-26  5:39               ` Willy Tarreau
2022-10-26  9:08                 ` Rasmus Villemoes
2022-10-26 19:52                   ` Willy Tarreau
2022-10-27  9:09                     ` Rasmus Villemoes
2022-10-27 17:20                       ` Willy Tarreau
2022-10-26 13:57                 ` Paul E. McKenney
2022-10-26 14:17                   ` Willy Tarreau

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=20221021170738.GM5600@paulmck-ThinkPad-P17-Gen-1 \
    --to=paulmck@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=w@1wt.eu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.