History

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().

Paolo Bonzini committed 6 years ago

Commit febd6681 parent cb953121 file · +1 −1Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/rcuwait.h+1−1
@@ -31,7 +31,7 @@ static inline void rcuwait_init(struct rcuwait *w) · 30 unmodified lines
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);