From: "Emilio G. Cota" <cota@braap.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "QEMU Developers" <qemu-devel@nongnu.org>,
"MTTCG Devel" <mttcg@greensocs.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Richard Henderson" <rth@twiddle.net>,
"Sergey Fedorov" <serge.fdrv@gmail.com>
Subject: Re: [Qemu-devel] [PATCH v2 2/3] atomics: emit an smp_read_barrier_depends() barrier only for Sparc and Thread Sanitizer
Date: Wed, 25 May 2016 11:06:33 -0400 [thread overview]
Message-ID: <20160525150633.GA4546@flamenco> (raw)
In-Reply-To: <1ed20476-934e-4ed7-89ea-69ec3d2f6680@redhat.com> <2668174b-abe5-5301-690f-8f199426a02e@redhat.com>
On Wed, May 25, 2016 at 14:16:56 +0200, Paolo Bonzini wrote:
> On 24/05/2016 22:06, Emilio G. Cota wrote:
> > For correctness, smp_read_barrier_depends() is only required to
> > emit a barrier on Sparc hosts. However, we are currently emitting
> > a consume fence unconditionally.
>
> Let's say why this is suboptimal:
>
> ... and most compilers currently treat consume and acquire fences as
> equivalent.
>
> Likewise, let's add a comment like this:
>
> +/* Most compilers currently treat consume and acquire the same, but really
> + * no processors except Alpha need a barrier here. Leave it in if
> + * using Thread Sanitizer to avoid warnings, otherwise optimize it away.
> + */
>
> If okay I can do the change myself.
On Wed, May 25, 2016 at 14:20:02 +0200, Paolo Bonzini wrote:
> On 24/05/2016 22:06, Emilio G. Cota wrote:
> > Currently we emit a consume-load in atomic_rcu_read. This is
> > overkill for non-Sparc hosts, and is only useful to make
> > things easier for Thread Sanitizer, which as far as I understand
> > works best without explicit fences.
>
> Likewise:
>
> Currently we emit a consume-load in atomic_rcu_read. Because of
> limitations in current compilers, this is overkill for non-Alpha hosts
> and it is only useful to make Thread Sanitizer work.
>
> and
>
> +/* See above: most compilers currently treat consume and acquire the
> + * same, but this slows down atomic_rcu_read unnecessarily.
> + */
Please go ahead with these changes. Don't forget to s/Sparc/Alpha/ on the
commit messages! There are 3 bogus Sparc's in the commit log of
(my) patch 2/3, including the commit title.
Thanks,
Emilio
next prev parent reply other threads:[~2016-05-25 15:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-24 20:06 [Qemu-devel] [PATCH v2 0/3] atomics: fix RCU perf. regression + update documentation Emilio G. Cota
2016-05-24 20:06 ` [Qemu-devel] [PATCH v2 1/3] docs/atomics: update atomic_read/set comparison with Linux Emilio G. Cota
2016-05-25 12:13 ` Paolo Bonzini
2016-05-24 20:06 ` [Qemu-devel] [PATCH v2 2/3] atomics: emit an smp_read_barrier_depends() barrier only for Sparc and Thread Sanitizer Emilio G. Cota
2016-05-24 20:09 ` Sergey Fedorov
2016-05-24 20:44 ` Emilio G. Cota
2016-05-25 12:16 ` Paolo Bonzini
2016-05-25 15:06 ` Emilio G. Cota [this message]
2016-05-24 20:06 ` [Qemu-devel] [PATCH v2 3/3] atomics: do not emit consume barrier for atomic_rcu_read Emilio G. Cota
2016-05-25 12:20 ` Paolo Bonzini
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=20160525150633.GA4546@flamenco \
--to=cota@braap.org \
--cc=alex.bennee@linaro.org \
--cc=mttcg@greensocs.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=serge.fdrv@gmail.com \
/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.