Re: [GIT PULL] random number generator updates for 6.1-rc1

From: Linus Torvalds
Date: Mon Oct 10 2022 - 13:49:06 EST


On Mon, Oct 3, 2022 at 10:45 AM Jason A. Donenfeld <Jason@xxxxxxxxx> wrote:
>
> - The original jitter algorithm intended (I believe) to schedule the timer for
> the next jiffy, not the next-next jiffy, yet it used mod_timer(jiffies + 1),
> which will fire on the next-next jiffy, instead of what I believe was
> intended, mod_timer(jiffies), which will fire on the next jiffy. So fix
> that. (If you did actually intend the next-next jiffy for this voodoo, let
> me know and I'll happily send you a new pull.)

Just as long as you verified that yes, it will actually do the next timer.

At some point we had timer logic that went "trigger timer callback
immediately if it was in the past". I didn't want to have to worry
about that, this the "jiffies + 1".

I suspect we long ago got rid of that "trigger immediately" because of
deadlocks, and that I was just being a worry-wart about behavior that
we haven't had for decades, so your patch looks fine. But you might
want to make sure.

Linus