]> git.hungrycats.org Git - linux/commit
[PATCH] random: SMP locking
authorAndrew Morton <akpm@osdl.org>
Sun, 31 Aug 2003 11:25:47 +0000 (04:25 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Sun, 31 Aug 2003 11:25:47 +0000 (04:25 -0700)
commitfbf6dda737a318eb352c426a0f6b99f06da222d2
treee43431d064d2496f670bc8773c6971a032b47967
parentb0c15cba55b1e2a870c6a60d4522b150c9dd04f0
[PATCH] random: SMP locking

From: Oliver Xymoron <oxymoron@waste.org>

This patch adds locking for SMP. Apparently Willy never managed to
revive his laptop with his version so I revived mine.

The batch pool is copied as a block to avoid long lock hold times
while mixing it into the primary pool.

Two locks are added:

gobal batch_lock
   batch_entropy_store can be called from any context, and typically from
   interrupts -> spin_lock_irqsave

   batch_entropy_process is called called via schedule_delayed_work and
   runs in process context -> spin_lock_irq

entropy_store.lock
   the mixing process is too expensive to be called from an interrupt
   context and the basic worker function extract_entropy can sleep, so
   all this stuff can be under a normal spin_lock
drivers/char/random.c