qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 1/2] rcu: Introduce force_rcu notifier


From: Richard Henderson
Subject: Re: [PATCH v4 1/2] rcu: Introduce force_rcu notifier
Date: Wed, 10 Nov 2021 10:44:55 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

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 via email to

[Prev in Thread] Current Thread [Next in Thread]