qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Greg Kurz <groug@kaod.org>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	qemu-stable@nongnu.org
Subject: Re: [PATCH v4 1/2] rcu: Introduce force_rcu notifier
Date: Wed, 10 Nov 2021 10:44:55 +0100	[thread overview]
Message-ID: <3599a3e1-3bef-9869-0bcf-e89402e0f7d4@linaro.org> (raw)
In-Reply-To: <20211109183523.47726-2-groug@kaod.org>

On 11/9/21 7:35 PM, Greg Kurz wrote:
> The drain_rcu_call() function can be blocked as long as an RCU reader
> stays in a read-side critical section. This is typically what happens
> when a TCG vCPU is executing a busy loop. It can deadlock the QEMU
> monitor as reported inhttps://gitlab.com/qemu-project/qemu/-/issues/650  .
> 
> This can be avoided by allowing drain_rcu_call() to enforce an RCU grace
> period. Since each reader might need to do specific actions to end a
> read-side critical section, do it with notifiers.
> 
> Prepare ground for this by adding a notifier list to the RCU reader
> struct and use it in wait_for_readers() if drain_rcu_call() is in
> progress. An API is added for readers to register their notifiers.
> 
> This is largely based on a draft from Paolo Bonzini.
> 
> Suggested-by: Paolo Bonzini<pbonzini@redhat.com>
> Signed-off-by: Greg Kurz<groug@kaod.org>
> ---
>   include/qemu/rcu.h | 15 +++++++++++++++
>   util/rcu.c         | 19 +++++++++++++++++++
>   2 files changed, 34 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


  reply	other threads:[~2021-11-10  9:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-09 18:35 [PATCH v4 0/2] accel/tcg: Fix monitor deadlock Greg Kurz
2021-11-09 18:35 ` [PATCH v4 1/2] rcu: Introduce force_rcu notifier Greg Kurz
2021-11-10  9:44   ` Richard Henderson [this message]
2021-11-09 18:35 ` [PATCH v4 2/2] accel/tcg: Register a " Greg Kurz
2021-11-10  9:47   ` Richard Henderson

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=3599a3e1-3bef-9869-0bcf-e89402e0f7d4@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=ehabkost@redhat.com \
    --cc=groug@kaod.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.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).