Re: pgsql: Fix a few problems in barrier.h. - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Fix a few problems in barrier.h.
Date
Msg-id 27664.1374115390@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Fix a few problems in barrier.h.  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-committers
Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Jul 17, 2013 at 6:39 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> On HPPA, implement pg_memory_barrier() as pg_compiler_barrier(), which
>> should be correct since this arch doesn't do memory access reordering,
>> and is anyway better than the completely-nonfunctional-on-this-arch
>> dummy_spinlock code.  (But note this patch only fixes things for gcc,
>> not for builds with HP's compiler.)

> According to http://en.wikipedia.org/wiki/Memory_ordering, PA-RISC has
> weak memory ordering.
> So either this commit is wrong, or one of those things is wrong.

If this commit is wrong, then our HPPA spinlock code has been wrong for
circa fifteen years.  It's entirely possible that that's true and nobody
has noticed (perhaps for lack of any multiprocessor HPPA systems to test
on?).  Still, that would make it roughly six orders of magnitude less
broken than "can't get through bootstrap", which is where we were this
morning.

As I hope my commit comment made clear, this is the beginning of making
barrier.h trustworthy, not the end.

            regards, tom lane


pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: Re: pgsql: Fix a few problems in barrier.h.
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Fix a few problems in barrier.h.