pgsql: Fix spinlock implementation for some !solaris sparc platforms.

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix spinlock implementation for some !solaris sparc platforms.
Date: 2014-09-09 21:54:20
Message-ID: E1XRTMi-00084I-1l@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(dot)GW26930(at)awork2(dot)anarazel(dot)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.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/f25e896016f5360df48fe7bfdb41c62494dc1277

Modified Files
--------------
src/backend/port/tas/sunstudio_sparc.s | 2 ++
src/include/storage/s_lock.h | 50 ++++++++++++++++++++++++++++++--
2 files changed, 50 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2014-09-09 22:12:35 pgsql: Add new psql help topics, accessible to both --help and \?.
Previous Message Andres Freund 2014-09-09 21:54:02 pgsql: Fix typo in solaris spinlock fix.