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().
Showing the changes to include/linux (1 of 1 file). Show all
Unified · Split
| @@ -31,7 +31,7 @@ static inline void rcuwait_init(struct rcuwait *w) · 30 unmodified lines | ||
| 31 | 31 | */ |
| 32 | 32 | static inline int rcuwait_active(struct rcuwait *w) |
| 33 | 33 | { |
| 34 | − return !!rcu_dereference(w->task); | |
| 34 | + return !!rcu_access_pointer(w->task); | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | extern int rcuwait_wake_up(struct rcuwait *w); |