]> granicus.if.org Git - postgresql/commit
Fix spinlock implementation for some !solaris sparc platforms.
authorAndres Freund <andres@anarazel.de>
Mon, 8 Sep 2014 22:47:32 +0000 (00:47 +0200)
committerAndres Freund <andres@anarazel.de>
Tue, 9 Sep 2014 21:48:03 +0000 (23:48 +0200)
commitf25e896016f5360df48fe7bfdb41c62494dc1277
tree6cdf43319e31ac5f0e8a283e2653f6d1b4eda618
parent44c5183287f346be80effc2e04b3e45a0f9bf560
Fix spinlock implementation for some !solaris sparc platforms.

Some Sparc CPUs can be run in various coherence models, ranging from
RMO (relaxed) over PSO (partial) to TSO (total). Solaris has always
run CPUs in TSO mode while in userland, but linux didn't use to and
the various *BSDs still don't. Unfortunately the sparc TAS/S_UNLOCK
were only correct under TSO. Fix that by adding the necessary memory
barrier instructions. On sparcv8+, which should be all relevant CPUs,
these are treated as NOPs if the current consistency model doesn't
require the barriers.

Discussion: 20140630222854.GW26930@awork2.anarazel.de

Will be backpatched to all released branches once a few buildfarm
cycles haven't shown up problems. As I've no access to sparc, this is
blindly written.
src/backend/port/tas/sunstudio_sparc.s
src/include/storage/s_lock.h