Re: [PATCH 01/10] random: make 'add_interrupt_randomness()' dosomething sane

From: Linus Torvalds
Date: Fri Jul 06 2012 - 12:24:17 EST


On Fri, Jul 6, 2012 at 6:01 AM, Theodore Ts'o <tytso@xxxxxxx> wrote:
> What in the world is "fast count"? I've grepped for it,
> and I can't find it.

It's your own fast-pool counter that Matt was talking about.

> I can simply not credit entropy of the timer is on the irq, but I
> think you and Matt were suggesting more subtle. I just have no idea
> how to tell if there were non-timer interrupts during the last HZ
> cycle. Can you give me a hint?

So instead of not calling the add_interrupt_randomness() at all if the
__IRQF_TIMER bit was set, just pass it in as an argument. That way you
can still use the cycle counter for mixing stuff, but the random.c
code could at least (perhaps in the future) decide that if all it has
seen is timer interrupts, and get_cycles() always returns zero (no
cycle counter), we won't count it as entropy.

At least with no-HZ there's still going to be *some* data there
because you won't get called for every tick, so things like random app
timers etc will affect even the timer interrupt distribution, but...

Linus
--
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/