lockdep.c (dd84cfff3cc3b79c9d616f85bd1178df135cbd1a) lockdep.c (e67198cc05b8ecbb7b8e2d8ef9fb5c8d26821873)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * kernel/lockdep.c
4 *
5 * Runtime locking correctness validator
6 *
7 * Started by Ingo Molnar:
8 *

--- 5418 unchanged lines hidden (view full) ---

5427 struct held_lock *hlock = curr->held_locks + i;
5428
5429 if (match_held_lock(hlock, lock)) {
5430 /*
5431 * Grab 16bits of randomness; this is sufficient to not
5432 * be guessable and still allows some pin nesting in
5433 * our u32 pin_count.
5434 */
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * kernel/lockdep.c
4 *
5 * Runtime locking correctness validator
6 *
7 * Started by Ingo Molnar:
8 *

--- 5418 unchanged lines hidden (view full) ---

5427 struct held_lock *hlock = curr->held_locks + i;
5428
5429 if (match_held_lock(hlock, lock)) {
5430 /*
5431 * Grab 16bits of randomness; this is sufficient to not
5432 * be guessable and still allows some pin nesting in
5433 * our u32 pin_count.
5434 */
5435 cookie.val = 1 + (prandom_u32() >> 16);
5435 cookie.val = 1 + (sched_clock() & 0xffff);
5436 hlock->pin_count += cookie.val;
5437 return cookie;
5438 }
5439 }
5440
5441 WARN(1, "pinning an unheld lock\n");
5442 return cookie;
5443}

--- 1121 unchanged lines hidden (view full) ---

6565 !rcu_lockdep_current_cpu_online()
6566 ? "RCU used illegally from offline CPU!\n"
6567 : "",
6568 rcu_scheduler_active, dl,
6569 dl ? "" : "Possible false positive due to lockdep disabling via debug_locks = 0\n");
6570
6571 /*
6572 * If a CPU is in the RCU-free window in idle (ie: in the section
5436 hlock->pin_count += cookie.val;
5437 return cookie;
5438 }
5439 }
5440
5441 WARN(1, "pinning an unheld lock\n");
5442 return cookie;
5443}

--- 1121 unchanged lines hidden (view full) ---

6565 !rcu_lockdep_current_cpu_online()
6566 ? "RCU used illegally from offline CPU!\n"
6567 : "",
6568 rcu_scheduler_active, dl,
6569 dl ? "" : "Possible false positive due to lockdep disabling via debug_locks = 0\n");
6570
6571 /*
6572 * If a CPU is in the RCU-free window in idle (ie: in the section
6573 * between rcu_idle_enter() and rcu_idle_exit(), then RCU
6573 * between ct_idle_enter() and ct_idle_exit(), then RCU
6574 * considers that CPU to be in an "extended quiescent state",
6575 * which means that RCU will be completely ignoring that CPU.
6576 * Therefore, rcu_read_lock() and friends have absolutely no
6577 * effect on a CPU running in that state. In other words, even if
6578 * such an RCU-idle CPU has called rcu_read_lock(), RCU might well
6579 * delete data structures out from under it. RCU really has no
6580 * choice here: we need to keep an RCU-free window in idle where
6581 * the CPU may possibly enter into low power mode. This way we can

--- 15 unchanged lines hidden ---
6574 * considers that CPU to be in an "extended quiescent state",
6575 * which means that RCU will be completely ignoring that CPU.
6576 * Therefore, rcu_read_lock() and friends have absolutely no
6577 * effect on a CPU running in that state. In other words, even if
6578 * such an RCU-idle CPU has called rcu_read_lock(), RCU might well
6579 * delete data structures out from under it. RCU really has no
6580 * choice here: we need to keep an RCU-free window in idle where
6581 * the CPU may possibly enter into low power mode. This way we can

--- 15 unchanged lines hidden ---