All of lore.kernel.org
 help / color / mirror / Atom feed
* [Question] srcu: is it making sense to recursively invoke srcu_read_lock?
@ 2022-04-21  4:22 Hillf Danton
  2022-04-21 13:34 ` Paul E. McKenney
  0 siblings, 1 reply; 5+ messages in thread
From: Hillf Danton @ 2022-04-21  4:22 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: Sean Christopherson, linux-kernel, linux-mm

Given rcu_lock_acquire() in srcu_read_lock(),

	iA = srcu_read_lock(foo);
	iB = srcu_read_lock(foo); // not bar
	...
	srcu_read_unlock(foo, iB);
	srcu_read_unlock(foo, iA);

can the call sequence above trigger warning with CONFIG_DEBUG_LOCK_ALLOC enabled?

Does it make sense to add srcu_lock_acquire() in line with rwsem_acquire_read() if
warning is expected but not triggered?

Thanks
Hillf

static inline void rcu_lock_acquire(struct lockdep_map *map)
{
	lock_acquire(map, 0, 0, 2, 0, NULL, _THIS_IP_);
}

static inline void srcu_lock_acquire(struct lockdep_map *map)
{
	lock_acquire(map, 0, 0, 1, 0, NULL, _THIS_IP_);
}


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-22  3:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-21  4:22 [Question] srcu: is it making sense to recursively invoke srcu_read_lock? Hillf Danton
2022-04-21 13:34 ` Paul E. McKenney
2022-04-21 23:08   ` Paul E. McKenney
2022-04-22  0:52   ` Hillf Danton
2022-04-22  3:09     ` Paul E. McKenney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.