• John Stultz's avatar
    locking/ww_mutex/test: Use prng instead of rng to avoid hangs at bootup · 4812c54d
    John Stultz authored
    
    
    Booting w/ qemu without kvm, and with 64 cpus, I noticed we'd
    sometimes hung task watchdog splats in get_random_u32_below()
    when using the test-ww_mutex stress test.
    
    While entropy exhaustion is no longer an issue, the RNG may be
    slower early in boot. The test-ww_mutex code will spawn off
    128 threads (2x cpus) and each thread will call
    get_random_u32_below() a number of times to generate a random
    order of the 16 locks.
    
    This intense use takes time and without kvm, qemu can be slow
    enough that we trip the hung task watchdogs.
    
    For this test, we don't need true randomness, just mixed up
    orders for testing ww_mutex lock acquisitions, so it changes
    the logic to use the prng instead, which takes less time
    and avoids the watchdgos.
    
    Feedback would be appreciated!
    Signed-off-by: default avatarJohn Stultz <jstultz@google.com>
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    Link: https://lore.kernel.org/r/20230922043616.19282-2-jstultz@google.com
    4812c54d
test-ww_mutex.c 13.7 KB