From: "Emilio G. Cota" <cota@braap.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org,
Peter Crosthwaite <crosthwaite.peter@gmail.com>,
Richard Henderson <rth@twiddle.net>,
David Gibson <david@gibson.dropbear.id.au>,
Alexander Graf <agraf@suse.de>, Riku Voipio <riku.voipio@iki.fi>,
Laurent Vivier <laurent@vivier.eu>,
qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/3] qom: implement CPU list with an RCU QLIST
Date: Tue, 14 Aug 2018 20:34:53 -0400 [thread overview]
Message-ID: <20180815003453.GA17669@flamenco> (raw)
In-Reply-To: <19faab37-6728-b649-488e-c6dc2e5be052@redhat.com>
On Tue, Aug 14, 2018 at 08:26:54 +0200, Paolo Bonzini wrote:
> On 13/08/2018 18:38, Emilio G. Cota wrote:
> > Fix it by implementing the CPU list as an RCU QLIST. This requires
> > a little bit of extra work to insert CPUs at the tail of
> > the list and to iterate over the list in reverse order (see previous patch).
> >
> > One might be tempted to just insert new CPUs at the head of the list.
> > However, I think this might lead to hard-to-debug issues, since it is
> > possible that callers are assuming that CPUs are inserted at the tail
> > (just like spapr code did in the previous patch). So instead of auditing
> > all callers, this patch simply keeps the old behaviour.
>
> Why not add an RCU_QSIMPLEQ
Because we can't atomically update both head.last and item.next.
> , or even use an array since the quadratic
> behavior should not be an issue? The advantage of the array is that
> reverse iteration becomes trivial.
I just gave this a shot. IMO implementing CPU_NEXT based on the
array is too ugly to live.
I think the poor man's tail insert + the CPU_FOREACH_REVERSE
are a better compromise.
Thanks,
Emilio
next prev parent reply other threads:[~2018-08-15 0:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-13 16:38 [Qemu-devel] [PATCH 0/3] convert CPU list to RCU Emilio G. Cota
2018-08-13 16:38 ` [Qemu-devel] [PATCH 1/3] qom: use cpu->in_cpu_list instead of QTAILQ_IN_USE Emilio G. Cota
2018-08-14 6:26 ` Paolo Bonzini
2018-08-13 16:38 ` [Qemu-devel] [PATCH 2/3] spapr: do not use CPU_FOREACH_REVERSE Emilio G. Cota
2018-08-14 1:11 ` David Gibson
2018-08-13 16:38 ` [Qemu-devel] [PATCH 3/3] qom: implement CPU list with an RCU QLIST Emilio G. Cota
2018-08-14 6:26 ` Paolo Bonzini
2018-08-15 0:34 ` Emilio G. Cota [this message]
2018-08-17 17:53 ` Paolo Bonzini
2018-08-19 9:06 ` Emilio G. Cota
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=20180815003453.GA17669@flamenco \
--to=cota@braap.org \
--cc=agraf@suse.de \
--cc=crosthwaite.peter@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=laurent@vivier.eu \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=riku.voipio@iki.fi \
--cc=rth@twiddle.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.