From: Paolo Bonzini <pbonzini@redhat.com>
To: "Emilio G. Cota" <cota@braap.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 0/3] rcu: add option to use upstream liburcu
Date: Wed, 04 Feb 2015 22:17:44 +0100 [thread overview]
Message-ID: <54D28C78.1070604@redhat.com> (raw)
In-Reply-To: <20150204210156.GA26445@flamenco>
On 04/02/2015 22:01, Emilio G. Cota wrote:
>> You're right, I was imprecise---I meant they are interoperable. You can
>> use atomic_rcu_read/write together with liburcu, you do not need to use
>> the liburcu-provided rcu_dereference/rcu_assign_pointer.
>
> It's true that they can coexist. I'm just not sold on having two ways
> of doing the same thing. It would make more sense to me to only divert
> from the original API if there's a good reason to do so -- otherwise
> an eventual merge (say after option a) discussed below) would be more
> painful than necessary.
The good reason was to mimic the C11 atomic_load/atomic_store functions.
>> As to call_rcu/call_rcu1, I understand there is a problem. Maybe call
>> the QEMU versions rcu_call/rcu_call1? Then you can add simple wrappers
>> if you want to use liburcu-mb.
>
> Again, adhering to the original API if possible makes more sense to me, to
> prevent future confusion.
Here the good reason is that QEMU's version of call_rcu is type-safe.
> Better testing, (eventually) less work, less bugs, no code duplication,
> ability to just merge new features from upstream.
>
> Essentially the usual reasons against forking a project.
Agreed.
>> QEMU hardly uses hash tables at all.
>
> I understand there's currently not much demand for these. I think however
> they might become valuable in the future, provided we end up having
> a multi-threaded TCG.
>
> If RCU's history in the linux kernel is of any guide, chances are RCU
> will end up being used in more places than one could initially guess:
>
> http://www2.rdrop.com/~paulmck/techreports/RCUUsage.2013.02.24a.pdf
Yes, that's possible. However, the "stupid coarse lock" strategy does
not work too well for Linux because you have N processes banging on the
same device or file system. QEMU has much higher separation between
components: all the complicated stuff happens in the guest.
> What I'm investigating now is how to do this in a manner that is palatable
> to upstream. For this as it's well known we need a multi-threaded TCG,
> and I believe quite a few bits from liburcu(-cds) might help to
> get there.
Are you using (or planning to use) a shared translated code cache, or a
separate cache for each CPU?
Paolo
> So for now I'll keep the liburcu(-cds) compile option in my tree and
> see how far I can get. Of course I'll keep fallback code using locks
> in there so that we can measure the performance differences.
>
> Thanks,
>
> Emilio
>
> [1] https://github.com/cdkersey/qsim
>
>
>
next prev parent reply other threads:[~2015-02-04 21:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-03 22:08 [Qemu-devel] [PATCH 0/3] rcu: add option to use upstream liburcu Emilio G. Cota
2015-02-03 22:08 ` [Qemu-devel] [PATCH 1/3] rcu: use call_rcu semantics from liburcu Emilio G. Cota
2015-02-03 22:08 ` [Qemu-devel] [PATCH 2/3] rcu: use rcu_{dereference, assign_pointer} instead of atomic_rcu_{read, set} Emilio G. Cota
2015-02-04 10:01 ` Paolo Bonzini
2015-02-04 17:25 ` Emilio G. Cota
2015-02-04 17:31 ` Paolo Bonzini
2015-02-03 22:08 ` [Qemu-devel] [PATCH 3/3] rcu: add liburcu knob to configure script Emilio G. Cota
2015-02-04 10:32 ` [Qemu-devel] [PATCH 0/3] rcu: add option to use upstream liburcu Paolo Bonzini
2015-02-04 21:01 ` Emilio G. Cota
2015-02-04 21:17 ` Paolo Bonzini [this message]
2015-02-04 23:12 ` 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=54D28C78.1070604@redhat.com \
--to=pbonzini@redhat.com \
--cc=cota@braap.org \
--cc=qemu-devel@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 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.