I need to take a look at the patches (on mobile now), but can anyone comment on how a barrier at unlock can provide ordering between mmio accesses under the same lock? Or is it required that every register have a unique lock?
CPU1:
lock()
write1
unlock()
CPU2, after CPU1:
lock()
write2
unlock()
Until now it was not guaranteed on all platforms that the writes arrive in the same order even if the CPU2 entered the critical section after CPU1.This was because spinlocks only implied regular memory barriers, not mmiowb barriers.
I don't really have any idea of the relative frequency of those two cases.