[fedora-arm] OpenMPI atomics patch

Nicolas Pitre nico at fluxnic.net
Wed Nov 14 00:30:12 UTC 2012


On Tue, 13 Nov 2012, Jon Masters wrote:

> On 11/11/2012 03:56 AM, Jon Masters wrote:
> 
> > This is an ugly kludge with some hand crafted assembly, but it builds
> > locally, and I think the scratch build should succeed this time. Note, I
> > was confused by the fact that there are at least *two* different sets of
> > atomics implemented in OMPI (it's a mess). With this, both are now
> > fixed, regardless of which compiler is being used.
> 
> I've updated the patch, following useful feedback from Nicolas Pitre.
> There is at least one bug in the current code (r3 clobbering, bad use of
> r12 because I knew it wasn't touched and didn't want to save it, which
> was just plain lazy and shouldn't have been done). I've tested these
> fixes in a little test harness and have a scratch going now:

I can see a few more issues in this patch:

The ARMv5 version of opal_atomic_add_32 doesn't return the new value as 
the ARMv6 version does.  If that is necessary, you'll need a "mov r0, 
r1" before the pop.  Same issue for opal_atomic_sub_32.

In the ARMv6 file, you use ldrexd/strexd instructions which are only 
available with the k extension of the ARMv6 architecture.  That means 
non-SMP ARMv6 variants won't support those instructions.  You probably 
should consider using the __kuser_cmpxchg64 kernel helper instead in 
that case.

And of course, the availability of __kuser_cmpxchg64 means that you 
could add 64 bit support to the ARMv5 version as well if you feel like 
it.


Nicolas


More information about the arm mailing list