mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
srcutree: Add lockdep and early-boot checks to synchronize_srcu_atomic()
Add the lockdep annotation, same-type SRCU nesting warning, and early-boot check used by __synchronize_srcu(). Suggested-by: Zqiang <qiang.zhang@linux.dev> Signed-off-by: Kunwu Chan <kunwu.chan@gmail.com> Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
This commit is contained in:
parent
0150a00d82
commit
91d2ab160c
|
|
@ -2122,6 +2122,14 @@ void synchronize_srcu_atomic(struct srcu_struct *ssp)
|
|||
unsigned long rdm0, rdm1;
|
||||
unsigned long unlocks0, unlocks1;
|
||||
|
||||
srcu_lock_sync(&ssp->dep_map);
|
||||
|
||||
RCU_LOCKDEP_WARN(lockdep_is_held(ssp),
|
||||
"Illegal synchronize_srcu_atomic() in same-type SRCU read-side critical section");
|
||||
|
||||
if (rcu_scheduler_active == RCU_SCHEDULER_INACTIVE)
|
||||
return;
|
||||
|
||||
// Initialize. Either init_srcu_struct() was invoked or
|
||||
// DEFINE_SRCU() or similar was used. Therefore, no allocation
|
||||
// will be done here.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user