random: make /dev/urandom scalable for silly userspace programs
authorTheodore Ts'o <tytso@mit.edu>
Mon, 2 May 2016 06:04:41 +0000 (02:04 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 3 Jul 2016 04:57:58 +0000 (00:57 -0400)
commit1e7f583af67be4ff091d0aeb863c649efd7a9112
tree2ffd7732681f0cd243ba0e2cb934cc37f59bd2ca
parente192be9d9a30555aae2ca1dc3aad37cba484cd4a
random: make /dev/urandom scalable for silly userspace programs

On a system with a 4 socket (NUMA) system where a large number of
application threads were all trying to read from /dev/urandom, this
can result in the system spending 80% of its time contending on the
global urandom spinlock.  The application should have used its own
PRNG, but let's try to help it from running, lemming-like, straight
over the locking cliff.

Reported-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
drivers/char/random.c