qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-stable@nongnu.org, qemu-devel@nongnu.org,
	Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: [PATCH v3 2/2] accel/tcg: Register a force_rcu notifier
Date: Tue, 9 Nov 2021 18:24:07 +0100	[thread overview]
Message-ID: <20211109182407.75f623f8@bahia> (raw)
In-Reply-To: <8a184041-39ad-1207-f32b-673e2b8da0f2@linaro.org>

On Tue, 9 Nov 2021 09:21:27 +0100
Richard Henderson <richard.henderson@linaro.org> wrote:

> On 11/9/21 8:54 AM, Richard Henderson wrote:
> > On 11/8/21 12:33 PM, Greg Kurz wrote:
> >> +static void rr_force_rcu(Notifier *notify, void *data)
> >> +{
> >> +    /*
> >> +     * Called with rcu_registry_lock held, using async_run_on_cpu() ensures
> >> +     * that there are no deadlocks.
> >> +     */
> >> +    async_run_on_cpu(first_cpu, do_nothing, RUN_ON_CPU_NULL);
> >> +}
> > 
> > Should first_cpu really be rr_current_cpu?
> > It's not clear to me that this will work for -smp 2 -cpu thread=single.
> 

Why wouldn't it work ? IIUC we always have a first_cpu and
async_run_on_cpu() will kick any vCPU currently run by the
RR thread... or am I missing something ?

Anyway, it seems more explicit to use rr_current_cpu.

> Alternately, no async_run_on_cpu at all, just rr_kick_next_cpu().
> 

Heh, this looks even better ! I'll try this right away.

Thanks Richard !

--
Greg

> 
> r~
> 



  reply	other threads:[~2021-11-09 17:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08 11:33 [PATCH v3 0/2] accel/tcg: Fix monitor deadlock Greg Kurz
2021-11-08 11:33 ` [PATCH v3 1/2] rcu: Introduce force_rcu notifier Greg Kurz
2021-11-08 11:33 ` [PATCH v3 2/2] accel/tcg: Register a " Greg Kurz
2021-11-09  7:54   ` Richard Henderson
2021-11-09  8:21     ` Richard Henderson
2021-11-09 17:24       ` Greg Kurz [this message]
2021-11-09 18:03         ` Paolo Bonzini
2021-11-09 18:29           ` Greg Kurz

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=20211109182407.75f623f8@bahia \
    --to=groug@kaod.org \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=richard.henderson@linaro.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).