Re: xlc atomics

From: Noah Misch <noah(at)leadboat(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Geoghegan <pg(at)heroku(dot)com>, Ants Aasma <ants(at)cybertec(dot)at>
Subject: Re: xlc atomics
Date: 2016-04-27 02:04:33
Message-ID: 20160427020433.GA2157946@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Apr 25, 2016 at 11:52:04AM -0700, Andres Freund wrote:
> On 2016-04-23 21:54:07 -0400, Noah Misch wrote:
> > The bug is that the pg_atomic_compare_exchange_*() specifications
> > grant "full barrier semantics", but generic-xlc.h provided only the
> > semantics of an acquire barrier.
>
> I find the docs at
> http://www-01.ibm.com/support/knowledgecenter/SSGH3R_13.1.2/com.ibm.xlcpp131.aix.doc/compiler_ref/bifs_sync_atomic.html
> to be be awfully silent about that matter. I guess you just looked at
> the assembler code? It's nice that one can figure out stuff like that
> from an architecture manual, but it's sad that the docs for the
> intrinsics is silent about that matter.

Right. The intrinsics provide little value as abstractions if one checks the
generated code to deduce how to use them. I was tempted to replace the
intrinsics calls with inline asm. At least these functions are unlikely to
change over time.

> Except that I didn't verify the rs6000_pre_atomic_barrier() and
> __fetch_and_add() internals about emitted sync/isync, the patch looks
> good. We've so far not referred to "sequential consistency", but given
> it's rise in popularity, I don't think it hurts.

Thanks; committed.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2016-04-27 02:20:31 Re: SET ROLE and reserved roles
Previous Message Robert Haas 2016-04-27 01:56:12 Re: EXPLAIN VERBOSE with parallel Aggregate