diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2020-05-18 13:30:09 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-05-20 10:39:40 +0300 |
commit | febd668d375caf13a7fcd93b3498366854de854a (patch) | |
tree | 510cec1c499c48e3e40076945d7a4f9156883c04 /include/linux/rcuwait.h | |
parent | cb953129bfe5c0f2da835a0469930873fb7e71df (diff) | |
download | linux-febd668d375caf13a7fcd93b3498366854de854a.tar.xz |
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 <kernellwp@gmail.com>
Tested-by: Wanpeng Li <kernellwp@gmail.com>
Acked-by: Davidlohr Bueso <dave@stgolabs.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/linux/rcuwait.h')
-rw-r--r-- | include/linux/rcuwait.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/rcuwait.h b/include/linux/rcuwait.h index c1414ce44abc..61c56cca95c4 100644 --- a/include/linux/rcuwait.h +++ b/include/linux/rcuwait.h @@ -31,7 +31,7 @@ static inline void rcuwait_init(struct rcuwait *w) */ static inline int rcuwait_active(struct rcuwait *w) { - return !!rcu_dereference(w->task); + return !!rcu_access_pointer(w->task); } extern int rcuwait_wake_up(struct rcuwait *w); |