Re: anole: assorted stability problems - Mailing list pgsql-hackers

From Andres Freund
Subject Re: anole: assorted stability problems
Date
Msg-id 20150629101108.GB17640@alap3.anarazel.de
Whole thread Raw
In response to Re: anole: assorted stability problems  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: anole: assorted stability problems  (Andres Freund <andres@anarazel.de>)
Re: anole: assorted stability problems  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On 2015-06-29 00:42:53 -0400, Tom Lane wrote:
> #define S_UNLOCK(lock)    \
>     do { _Asm_sched_fence(); (*(lock)) = 0; } while (0)

Robert, how did you choose that? Isn't _Asm_sched_fence just a compiler
barrier? Shouldn't this be a _Asm_mf()?

> which immediately raises the question of why omitting the "volatile"
> cast is okay.

Should be fine if _Asm_sched_fence() were a proper memory (or een
release) barrier. Which I don't think it is.


> I also wonder if we don't need a second _Asm_sched_fence() after the
> lock release.

Shouldn't be needed - the only thing that could be reordered is the
actual lock release. Which will just impact timing in a minor manner (it
can't move into another locked section).

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: UPSERT on partition
Next
From: Thomas Munro
Date:
Subject: Re: Rework the way multixact truncations work