linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	dave.hansen@linux.intel.com, linux-kernel@vger.kernel.org,
	x86@kernel.org
Subject: Re: [PATCH v2] selftests/x86: add "ffff8" -- kernel memory scanner
Date: Tue, 1 Nov 2022 00:04:53 -0700	[thread overview]
Message-ID: <6bbbb89b-1339-e5a1-b127-09270327b6c8@intel.com> (raw)
In-Reply-To: <Y2DAk9zKYG9hT/Ov@p183>

On 10/31/22 23:45, Alexey Dobriyan wrote:
> On Mon, Oct 31, 2022 at 02:37:43PM -0700, Dave Hansen wrote:
>> On 10/29/22 10:25, Alexey Dobriyan wrote:
>>> 	$ ./ffff8_64 -h
>>> 	usage: ./ffff8_64 [-f] [-r] [-n N] [-s S]
>>> 	        -f: sequential scan
>>> 	        -r: random scan (default)
>>> 	        -n: use N threads (default: $(nproc))
>>> 	        -s: lowest address shift (default: 47)
>>> 	        -t: time to run (default: 256 seconds)
>> Does this mean that if someone is just running all kernel selftests,
>> they need to wait for 256 seconds for this to finish?
> Yes. But low time will cover negligible amount of address space.
> 
> Is there some kind of policy to not do this? LTP surely has similar
> tests for races.

There's no written policy that I know of.  But, right now, the entirety
of the x86 selftests will run in a second or two.  It's actually
something I run in a loop to stress the entry/exit paths when I'm
messing with them.  Something silly like this:

	for i in *_32 *_64; do ./$i; done

Just picking a number out of thin air, I'd say that running for a couple
of seconds, like 2 is fine by default for any one tests.  Longer than
that, and it'll be out of whack with all the other x86 selftests.  If
it's 256 seconds, it just won't get run.

Yes, a single run will not have as much coverage, but a lot of people
run those tests (think 0day) and some folks run them a *lot*, like how I
run them in a loop.

The MPX selftest that was in there was in a similar situation.  It
*could* run for a long, long time and that helped because address
randomization would eventually help find some of the nastier corner
cases.  But, it was limited to a few seconds.

I really think we should stick to just a few seconds at most for any
individual test.

  reply	other threads:[~2022-11-01  7:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-28 19:33 [PATCH] selftests/x86: add "ffff8" -- kernel memory scanner Alexey Dobriyan
2022-10-28 22:14 ` H. Peter Anvin
2022-10-29  9:55   ` Alexey Dobriyan
2022-10-29 17:25   ` [PATCH v2] " Alexey Dobriyan
2022-10-31 21:37     ` Dave Hansen
2022-11-01  6:45       ` Alexey Dobriyan
2022-11-01  7:04         ` Dave Hansen [this message]
2022-11-23 13:29           ` [PATCH v3] " Alexey Dobriyan
2022-10-29  2:14 ` [PATCH] " Bagas Sanjaya
2022-10-29  9:45   ` Alexey Dobriyan

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=6bbbb89b-1339-e5a1-b127-09270327b6c8@intel.com \
    --to=dave.hansen@intel.com \
    --cc=adobriyan@gmail.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).