Skip to content

Commit febd668

Browse files
committed
rcuwait: avoid lockdep splats from rcuwait_active()
rcuwait_active only returns whether w->task is not NULL. This is exactly one of the usecases that are mentioned in the documentation for rcu_access_pointer() where it is correct to bypass lockdep checks. This avoids a splat from kvm_vcpu_on_spin(). Reported-by: Wanpeng Li <[email protected]> Tested-by: Wanpeng Li <[email protected]> Acked-by: Davidlohr Bueso <[email protected]> Cc: Peter Zijlstra <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent cb95312 commit febd668

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/rcuwait.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static inline void rcuwait_init(struct rcuwait *w)
3131
*/
3232
static inline int rcuwait_active(struct rcuwait *w)
3333
{
34-
return !!rcu_dereference(w->task);
34+
return !!rcu_access_pointer(w->task);
3535
}
3636

3737
extern int rcuwait_wake_up(struct rcuwait *w);

0 commit comments

Comments
 (0)