summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-06-19 16:47:41 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2022-06-19 16:47:41 +0200
commit4afb65156a79c59fbdbc10abb0bf06ff83f73e23 (patch)
treee28c6ee5f88c3003bf877d5a4fda8f6c3fdd6a57 /kernel
parentMerge tag 'irq-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kerne... (diff)
parentlocking/lockdep: Use sched_clock() for random numbers (diff)
downloadlinux-4afb65156a79c59fbdbc10abb0bf06ff83f73e23.tar.xz
linux-4afb65156a79c59fbdbc10abb0bf06ff83f73e23.zip
Merge tag 'locking-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull lockdep fix from Thomas Gleixner: "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" * tag 'locking-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: locking/lockdep: Use sched_clock() for random numbers
Diffstat (limited to 'kernel')
-rw-r--r--kernel/locking/lockdep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 81e87280513e..f06b91ca6482 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -5432,7 +5432,7 @@ static struct pin_cookie __lock_pin_lock(struct lockdep_map *lock)
* be guessable and still allows some pin nesting in
* our u32 pin_count.
*/
- cookie.val = 1 + (prandom_u32() >> 16);
+ cookie.val = 1 + (sched_clock() & 0xffff);
hlock->pin_count += cookie.val;
return cookie;
}