From: Jonathan Wakely <jwakely@redhat.com>
To: Matthias Kretz <m.kretz@gsi.de>
Cc: Jason Merrill <jason@redhat.com>,
"Richard Earnshaw (lists)" <Richard.Earnshaw@arm.com>,
"libstdc++" <libstdc++@gcc.gnu.org>,
gcc-patches List <gcc-patches@gcc.gnu.org>,
GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH] c++: implement C++17 hardware interference size
Date: Fri, 16 Jul 2021 20:58:36 +0100 [thread overview]
Message-ID: <CACb0b4mnB-VdnuB3XJGaEjHGvRiJjYZiAUC7nU+5ca+drued6g@mail.gmail.com> (raw)
In-Reply-To: <2948804.xd1mhZDcFd@excalibur>
On Fri, 16 Jul 2021 at 20:26, Matthias Kretz <m.kretz@gsi.de> wrote:
>
> On Friday, 16 July 2021 18:54:30 CEST Jonathan Wakely wrote:
> > On Fri, 16 Jul 2021 at 16:33, Jason Merrill wrote:
> > > Adjusting them based on tuning would certainly simplify a significant use
> > > case, perhaps the only reasonable use. Cases more concerned with ABI
> > > stability probably shouldn't use them at all. And that would mean not
> > > needing to worry about the impossible task of finding the right values for
> > > an entire architecture.
> >
> > But it would be quite a significant change in behaviour if -mtune
> > started affecting ABI, wouldn't it?
>
> For existing code -mtune still doesn't affect ABI.
True, because existing code isn't using the constants.
>The users who write
>
> struct keep_apart {
> alignas(std::hardware_destructive_interference_size) std::atomic<int> cat;
> alignas(std::hardware_destructive_interference_size) std::atomic<int> dog;
> };
>
> *want* to have different sizeof(keep_apart) depending on the CPU the code is
> compiled for. I.e. they *ask* for getting their ABI broken.
Right, but the person who wants that and the person who chooses the
-mtune option might be different people.
A distro might add -mtune=core2 to all package builds by default, not
expecting it to cause ABI changes. Some header in a package in the
distro might start using the constants. Now everybody who includes
that header needs to use the same -mtune option as the distro default.
That change in the behaviour and expected use of an existing option
seems scary to me. Even with a warning about using the constants
(because somebody's just going to use #pragma around their use of the
constants to disable the warning, and now the ABI impact of -mtune is
much less obvious).
It's much less scary in a world where the code is written and used by
the same group of people, but for something like a linux distro it
worries me.
next prev parent reply other threads:[~2021-07-16 19:58 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-16 2:36 Jason Merrill
2021-07-16 2:41 ` Jason Merrill
2021-07-16 2:48 ` Noah Goldstein
2021-07-16 11:17 ` Jonathan Wakely
2021-07-16 13:27 ` Richard Earnshaw
2021-07-16 13:26 ` Jonathan Wakely
2021-07-16 15:12 ` Matthias Kretz
2021-07-16 15:30 ` Jason Merrill
2021-07-16 16:54 ` Jonathan Wakely
2021-07-16 18:43 ` Jason Merrill
2021-07-16 19:26 ` Matthias Kretz
2021-07-16 19:58 ` Jonathan Wakely [this message]
2021-07-17 8:14 ` Matthias Kretz
2021-07-17 13:32 ` Jonathan Wakely
2021-07-17 13:54 ` Matthias Kretz
2021-07-17 21:37 ` Jason Merrill
2021-07-19 9:41 ` Richard Earnshaw
2021-07-20 16:43 ` Jason Merrill
2021-09-10 13:16 ` [PATCH RFC] " Jason Merrill
2021-09-14 7:56 ` Christophe LYON
2021-09-15 10:25 ` Richard Earnshaw
2021-09-15 11:30 ` Christophe Lyon
2021-09-15 12:31 ` Martin Liška
2021-09-15 15:31 ` [pushed] c++: don't warn about internal interference sizes Jason Merrill
2021-09-15 15:36 ` Jeff Law
2021-09-15 15:38 ` Jason Merrill
2021-09-15 16:15 ` Christophe Lyon
2021-09-15 15:35 ` [PATCH RFC] c++: implement C++17 hardware interference size Jason Merrill
2021-07-20 18:05 ` [PATCH] " Thomas Rodgers
2021-07-16 17:20 ` Noah Goldstein
2021-07-16 19:37 ` Matthias Kretz
2021-07-16 21:23 ` Noah Goldstein
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=CACb0b4mnB-VdnuB3XJGaEjHGvRiJjYZiAUC7nU+5ca+drued6g@mail.gmail.com \
--to=jwakely@redhat.com \
--cc=Richard.Earnshaw@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jason@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=libstdc++@gcc.gnu.org \
--cc=m.kretz@gsi.de \
/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).