Re: [GIT pull] locking/urgent for 5.19-rc3
From: Linus Torvalds
Date: Sun Jun 19 2022 - 10:52:50 EST
On Sun, Jun 19, 2022 at 8:12 AM Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>
> A RT fix for lockdep. lockdep invokes prandom_u32() to create cookies. This
> worked until prandom_u32() was switched to the real random generator, which
> takes a spinlock for extraction, which does not work on RT when invoked
> from atomic contexts. lockdep has no requirement for real random numbers
> and it turns out sched_clock() is good enough to create the cookie. That
> works everywhere and is faster.
So this is obviously fine and works ok, but I do think it highlights
that maybe that prandom change was a bad bad idea.
Even outside of RT, you might end up getting nasty locks within locks.
Not a deadlock, but a "this was just pointless".
Linus