public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marc Glisse <marc.glisse@inria.fr>
To: Maged Michael <maged.michael@gmail.com>
Cc: libstdc++@gcc.gnu.org
Subject: Re: Proposed patch to skip the last atomic decrements in _Sp_counted_base::_M_release
Date: Tue, 8 Dec 2020 09:01:23 +0100 (CET)	[thread overview]
Message-ID: <64ffb83-460-eb85-108c-df9fc1212654@stedding.saclay.inria.fr> (raw)
In-Reply-To: <CABBFi09ovWwPpUnC2V_vU5iVMLR0vQd77EgrO5XTFPOofmWzdQ@mail.gmail.com>

On Mon, 7 Dec 2020, Maged Michael via Libstdc++ wrote:

> Any pointers on where to file bug reports about the generated code?

https://gcc.gnu.org/bugzilla/
(creating an account may not be as trivial as it used to be, but it still 
works)

>> ISTR that libstdc++ uses a surprisingly strong memory barrier when
>> incrementing references (acq_rel, where I would expect acquire to suffice,
>> although I haven't thought about weak references that much). Did you also
>> experiment with that?

(I actually meant "relaxed")

> I applied to x86, where acq_rel doesn't add extra memory fence instructions
> for atomic increment/decrement operations.

Indeed, on x86 just making the increment atomically requires lock add or
lock inc, which already includes a strong barrier. It does make a
difference in generated code on aarch64 or powerpc64el though.

-- 
Marc Glisse

  reply	other threads:[~2020-12-08  8:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-07 12:24 Maged Michael
2020-12-07 15:28 ` Marc Glisse
2020-12-07 15:41   ` Jonathan Wakely
2020-12-08  4:10   ` Maged Michael
2020-12-08  8:01     ` Marc Glisse [this message]
2020-12-08  9:56       ` Jonathan Wakely
2020-12-07 15:37 ` Jonathan Wakely
2020-12-08  4:06   ` Maged Michael
2020-12-07 12:30 Maged Michael
2020-12-07 15:57 ` Jonathan Wakely
2020-12-07 16:23   ` Jonathan Wakely

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=64ffb83-460-eb85-108c-df9fc1212654@stedding.saclay.inria.fr \
    --to=marc.glisse@inria.fr \
    --cc=libstdc++@gcc.gnu.org \
    --cc=maged.michael@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 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 read-only IMAP folder(s) and NNTP newsgroup(s).