[fedora-arm] ARMv5 and atomic operations

Nicolas Pitre nico at fluxnic.net
Tue Apr 24 16:54:13 UTC 2012


On Tue, 24 Apr 2012, Jon Masters wrote:

> I wasn't going to reply yet just due to lack of time and because Nico
> covered the kernel helper stuff so well in his earlier posts. But just
> to add, these kernel helpers have grown a little over time in higher
> kernel revisions, but there is a mechanism to discover the revision
> available (note: these are not VDSO but if it helps folks understand
> them, think of them like that). They are the right way to solve the
> atomics problem as best as we can for older devices.

The kernel helpers have been there, for the most part, since v2.6.15 
which should be good enough.  The only recent addition in v3.1 was 
cmpxchg64.

> I believe the correct thing to do is to get broken upstream projects 
> to adopt generic non-reimplemented-of-their-own routines that will 
> transparently use the kernel helpers if needed. It would be sad to 
> give up on v5 just yet, but we are also in this for the longer haul, 
> and newer Plugs are going to be switching to v7 over time. So, in due 
> course, I am open to also considering a switch to v6 (with or without 
> smp).

Note that ARMv6 doesn't have 64-bit atomic support either.  You need to 
move to ARMv6K and above for them to be natively available, meaning even 
more recent hardware than plain ARMv6.

So if you really really need 64 bit atomic ops (and in most cases this 
is unnecessary IMHO) then you must have an SMP capable CPU in practice, 
or a kernel version equal to 3.1 or later.


Nicolas


More information about the arm mailing list