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 1744.1290185829@sss.pgh.pa.us
Whole thread Raw
In response to Re: Latches with weak memory ordering (Re: max_wal_senders must die)  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> I was never talking about 'locking the whole cache' - I was talking about 
> flushing/fencing it like a "global" read/write barrier would. And "lock 
> xchgb/xaddl" does not imply anything for other cachelines but its own.

If that's the case, why aren't the parallel regression tests falling
over constantly?  My recollection is that when I broke the sinval code
by assuming strong memory ordering without spinlocks, it didn't take
long at all for the PPC buildfarm members to expose the problem.
If it's possible for Intel-ish processors to exhibit weak memory
ordering behavior, I'm quite sure that our current code would be showing
bugs everywhere.

The impression I had of current Intel designs is that they ensure global
cache coherency, ie if one processor has a dirty cache line the others
know that, and will go get the updated data before attempting to access
that piece of memory.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Latches with weak memory ordering (Re: max_wal_senders must die)
Next
From: Alvaro Herrera
Date:
Subject: Re: libpq changes for synchronous replication