Re: [PATCH REPOST for 2.6.25] Use an own random generator for pageattr-test.c

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andi Kleen
Date: Tuesday, March 11, 2008 - 2:49 pm

On Tue, Mar 11, 2008 at 10:08:07PM +0100, Thomas Gleixner wrote:

The original idea was that there is enough variability in memory
maps that you still get the various scenarios tested, but that
a boot on a single machine stays deterministic in its behaviour.


If you wanted to do that you would need some variant of my patch too --
to do it with random32() you would first need to print all NR_CPUS
state (and implement "kernel less" first for NR_CPUS > 128 kernels :),
then keep track of all CPUs the test thread ran on and print that
out too and also disable the regular timer reseeder to avoid races.
Clearly doesn't make sense.

random32() in lib/ is simply unusable as a deterministic RND,
it's more like super weak strange /dev/random variant which
probably should be never put into lib/ anyways because it's unlikely
to be generally useful.

So for a random but repeatable sequence like you describe you could keep the 
patch, replace the static int next = 1; with static int next and add a 
get_random_bytes(&next, sizeof(next)); and then print out the next value

-andi

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH REPOST for 2.6.25] Use an own random generator ..., Andi Kleen, (Tue Mar 11, 2:49 pm)