History

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

Linus Torvalds committed 4 years ago

Commit 4afb6512 parents 36da9f5 4051a811 file · +1 −1Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/locking/lockdep.c+1−1
@@ -5432,7 +5432,7 @@ static struct pin_cookie __lock_pin_lock(struct lockdep_map *lock) · 5431 unmodified lines
5432 * be guessable and still allows some pin nesting in5432 * be guessable and still allows some pin nesting in
5433 * our u32 pin_count.5433 * our u32 pin_count.
5434 */5434 */
5435 cookie.val = 1 + (prandom_u32() >> 16);5435 cookie.val = 1 + (sched_clock() & 0xffff);
5436 hlock->pin_count += cookie.val;5436 hlock->pin_count += cookie.val;
5437 return cookie;5437 return cookie;
5438 }5438 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t