Re: Latches with weak memory ordering (Re: max_wal_senders must die) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Latches with weak memory ordering (Re: max_wal_senders must die)
Date
Msg-id 2709.1290188760@sss.pgh.pa.us
Whole thread Raw
In response to Re: Latches with weak memory ordering (Re: max_wal_senders must die)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Latches with weak memory ordering (Re: max_wal_senders must die)
List pgsql-hackers
I wrote:
> Markus Wanner <markus@bluegap.ch> writes:
>> Well, that certainly doesn't apply to full fences, that are not specific
>> to a particular piece of memory. I'm thinking of 'mfence' on x86_64 or
>> 'mf' on ia64.

> Hm, what do those do exactly?

I poked around in the Intel manuals a bit.  They do have mfence (also
lfence and sfence) but so far as I can tell, those are only used to
manage loads and stores that are issued by special instructions that
explicitly mark the operation as weakly ordered.  So the reason we're
not seeing bugs is presumably that C compilers don't generate such
instructions.  Also, Intel architectures do guarantee cache consistency
across multiple processors (and it costs them a lot...)

I found a fairly interesting and detailed paper about memory fencing
in the Linux kernel:
http://www.rdrop.com/users/paulmck/scalability/paper/ordering.2007.09.19a.pdf
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Ross J. Reedstrom"
Date:
Subject: Re: contrib: auth_delay module
Next
From: "Kevin Grittner"
Date:
Subject: Re: Latches with weak memory ordering (Re: max_wal_senders must die)