Re: [PATCH 02/10] random: use lockless techniques when mixingentropy pools

From: Greg KH
Date: Thu Jul 05 2012 - 14:19:55 EST


On Thu, Jul 05, 2012 at 02:12:05PM -0400, Theodore Ts'o wrote:
> The real-time Linux folks didn't like add_interrupt_randomness()
> taking a spinlock since it is called in the low-level interrupt
> routine. Using atomic_t's and cmpxchg is also too expensive on some
> of the older architectures. So we'll bite the bullet and use
> ACCESS_ONCE() and smp_rmb()/smp_wmb() to minimize the race windows
> when mixing in the entropy pool.
>
> Also, we will use a trylock when trying to increase then entropy
> accounting during the interrupt path to avoid taking a spinlock there;
> if there is contention, we will simply not credit the entropy count,
> thus failing safe. Thanks to Dan Carpenter for suggesting this
> approach.
>
> Signed-off-by: "Theodore Ts'o" <tytso@xxxxxxx>
> ---

Any reason you don't want this backported to the -stable series?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/