From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, sultan@kerneltoast.com
Subject: Re: [GIT PULL] random number generator updates for 6.1-rc1
Date: Mon, 10 Oct 2022 12:32:34 -0600 [thread overview]
Message-ID: <Y0RlQi/72JrfW3df@zx2c4.com> (raw)
In-Reply-To: <CAHk-=wgGc7MYRW=vXyY-m_r9c7-_i8k1nsHM0RuJw_9qZWWP9g@mail.gmail.com>
Hey Linus,
On Mon, Oct 10, 2022 at 10:48:42AM -0700, Linus Torvalds wrote:
> On Mon, Oct 3, 2022 at 10:45 AM Jason A. Donenfeld <Jason@zx2c4.com> 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.
I checked this and it works. Sultan and I jumped pretty far down the
timers rabbit hole in the process of investigating 748bc4dd9e66
("random: use expired timer rather than wq for mixing fast pool"). If
you grep the kernel, expiring at "jiffies" is a fairly common pattern
too.
Jason
next prev parent reply other threads:[~2022-10-10 18:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-03 17:44 [GIT PULL] random number generator updates for 6.1-rc1 Jason A. Donenfeld
2022-10-10 17:48 ` Linus Torvalds
2022-10-10 18:32 ` Jason A. Donenfeld [this message]
2022-10-10 17:56 ` Linus Torvalds
2022-10-10 18:37 ` Jason A. Donenfeld
2022-10-10 18:48 ` pr-tracker-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y0RlQi/72JrfW3df@zx2c4.com \
--to=jason@zx2c4.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sultan@kerneltoast.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox