From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: ARM atomics overhaul for musl
Date: Sun, 16 Nov 2014 18:23:37 -0500 [thread overview]
Message-ID: <20141116232337.GZ22465@brightrain.aerifal.cx> (raw)
In-Reply-To: <1416177195.16479.110.camel@eris.loria.fr>
On Sun, Nov 16, 2014 at 11:33:15PM +0100, Jens Gustedt wrote:
> Hello,
>
> Am Sonntag, den 16.11.2014, 00:56 -0500 schrieb Rich Felker:
> > One item on the agenda for this release cycle is overhauling the way
> > atomics are done on ARM. I'm cc'ing people who have been involved in
> > this discussion in the past in case anyone's not on the musl list and
> > has opinions about what should be done.
> >
> > The current situation looks like the following: ...
>
> I don't know enough about the nasty details of this architecture to be
> helpful, I think. But what I'd very much like to have is some sort of
> documentation or standards concerning memory ordering for the atomics
> that we use internally.
At present, the assumptions made about musl's atomic primitives used
internally is that they meet the POSIX requirement for synchronizing
memory. They are at least acquire+release barriers. Assuming a POSIX
memory model that does not have atomic objects and where you can only
access memory when simultaneous modification is excluded by
synchronizing functions, I think this is equivalent to sequential
consistency, but it's not necessarily equivalent when the application
can access atomic objects itself. Does this sound correct?
> And also about which OS features are
> needed/missing to make atomic operations appear stateless (AKA
> "lockfree" in C11 terminology).
This is purely dependent on having a hardware CAS of the correct size.
musl requires int- and long/pointer-sized CAS, and IMO it's impossible
to implement POSIX correctly without them (of course they could be
emulated by kernel blocking interrupts and shutting down all but one
core temporarily).
> Since this is the most complicated architecture (or merely family of
> architectures) this is probably the best to start such a reflection.
The complexities being discussed here are complexities in the
instruction set architecture and the kernel's failure to report the
particular variant in use in a reasonable way. The memory model is
just a pretty standard relaxed-order.
Rich
prev parent reply other threads:[~2014-11-16 23:23 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-16 5:56 Rich Felker
2014-11-16 16:33 ` Russell King - ARM Linux
2014-11-16 16:50 ` Rich Felker
2014-11-16 17:10 ` Russell King - ARM Linux
2014-11-16 18:27 ` Andy Lutomirski
2014-11-16 18:56 ` Rich Felker
2014-11-16 19:02 ` Rich Felker
2014-11-17 13:54 ` Catalin Marinas
2014-11-17 14:11 ` Szabolcs Nagy
2014-11-17 14:47 ` Catalin Marinas
2014-11-17 14:39 ` Russell King - ARM Linux
2014-11-17 15:26 ` Catalin Marinas
2014-11-17 15:47 ` Russell King - ARM Linux
2014-11-17 16:19 ` Catalin Marinas
2014-11-17 16:53 ` Russell King - ARM Linux
2014-11-17 17:48 ` Catalin Marinas
2014-11-17 17:38 ` Andy Lutomirski
2014-11-18 10:56 ` Catalin Marinas
2014-11-18 18:14 ` Will Deacon
2014-11-18 18:24 ` Andy Lutomirski
2014-11-18 19:19 ` Russell King - ARM Linux
2014-11-19 18:32 ` Catalin Marinas
2014-11-17 11:48 ` Catalin Marinas
2014-11-17 12:21 ` Arnd Bergmann
2014-11-17 13:30 ` Szabolcs Nagy
2014-11-17 14:34 ` Catalin Marinas
2014-11-16 22:33 ` Jens Gustedt
2014-11-16 23:23 ` Rich Felker [this message]
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=20141116232337.GZ22465@brightrain.aerifal.cx \
--to=dalias@libc.org \
--cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).