kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wanpeng Li <kernellwp@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Marc Zyngier <maz@kernel.org>,
	Sebastian Sewior <bigeasy@linutronix.de>,
	Steven Rostedt <rostedt@goodmis.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	will@kernel.org, joel@joelfernandes.org,
	LKML <linux-kernel@vger.kernel.org>, kvm <kvm@vger.kernel.org>,
	Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH 4/5] rcuwait: Introduce rcuwait_active()
Date: Tue, 19 May 2020 08:34:24 +0800	[thread overview]
Message-ID: <CANRm+CxXacjtTZe8gGLR+iH_X8QrC2R_2ncL9aMB2ukoEmn8FQ@mail.gmail.com> (raw)
In-Reply-To: <57309494-58bf-a11e-e4ac-e669e6af22f2@redhat.com>

On Mon, 18 May 2020 at 18:36, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 24/04/20 07:48, Davidlohr Bueso wrote:
> > +/*
> > + * Note: this provides no serialization and, just as with waitqueues,
> > + * requires care to estimate as to whether or not the wait is active.
> > + */
> > +static inline int rcuwait_active(struct rcuwait *w)
> > +{
> > +     return !!rcu_dereference(w->task);
> > +}
>
> This needs to be changed to rcu_access_pointer:
>
>
> --------------- 8< -----------------
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH] 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>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Tested-by: Wanpeng Li <wanpengli@tencent.com>

  parent reply	other threads:[~2020-05-19  0:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24  5:48 [PATCH v4 0/5] kvm: Use rcuwait for vcpu blocking Davidlohr Bueso
2020-04-24  5:48 ` [PATCH 1/5] rcuwait: Fix stale wake call name in comment Davidlohr Bueso
2020-04-24  5:48 ` [PATCH 2/5] rcuwait: Let rcuwait_wake_up() return whether or not a task was awoken Davidlohr Bueso
2020-04-24  5:48 ` [PATCH 3/5] rcuwait: Introduce prepare_to and finish_rcuwait Davidlohr Bueso
2020-04-24  5:48 ` [PATCH 4/5] rcuwait: Introduce rcuwait_active() Davidlohr Bueso
2020-04-24  9:55   ` Peter Zijlstra
2020-05-18 10:33   ` Paolo Bonzini
2020-05-18 16:37     ` Davidlohr Bueso
2020-05-19  0:34     ` Wanpeng Li [this message]
2020-04-24  5:48 ` [PATCH 5/5] kvm: Replace vcpu->swait with rcuwait Davidlohr Bueso
2020-04-25 10:24   ` Paolo Bonzini
2020-04-25 22:30     ` Davidlohr Bueso
2020-05-18  8:51   ` Wanpeng Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANRm+CxXacjtTZe8gGLR+iH_X8QrC2R_2ncL9aMB2ukoEmn8FQ@mail.gmail.com \
    --to=kernellwp@gmail.com \
    --cc=bigeasy@linutronix.de \
    --cc=dave@stgolabs.net \
    --cc=dbueso@suse.de \
    --cc=joel@joelfernandes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).