Re: Latches with weak memory ordering (Re: max_wal_senders must die)

From: Andres Freund <andres(at)anarazel(dot)de>
To: Aidan Van Dyk <aidan(at)highrise(dot)ca>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Josh Berkus <josh(at)agliodbs(dot)com>
Subject: Re: Latches with weak memory ordering (Re: max_wal_senders must die)
Date: 2010-11-19 15:06:33
Message-ID: 201011191606.34417.andres@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Friday 19 November 2010 15:58:39 Aidan Van Dyk wrote:
> On Fri, Nov 19, 2010 at 9:49 AM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> > Well, its not generally true - you are right there. But there is a wide
> > range for syscalls available where its inherently true (which is what I
> > sloppily referred to). And you are allowed to call a, although quite
> > restricted, set of system calls even in signal handlers. I don't have
> > the list for older posix versions in mind, but for 2003 you can choose
> > something from several like write, lseek,setpgid which inherently have
> > to serialize. And I am quite sure there were sensible calls for earlier
> > versions.
>
> Well, it's not quite enough just to call into the kernel to serialize
> on "some point of memory", because your point is to make sure that
> *this particular piece of memory* is coherent. It doesn't matter if
> the kernel has proper fencing in it's stuff if the memory it's
> guarding is in another cacheline, because that won't *necessarily*
> force cache coherency in your local lock/variable memory.
Yes and no. It provides the same guarantees as our current approach of using
spinlocks for exactly that - that it theoretically is not enough is an
independent issue (but *definitely* an issue).

Andres

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Markus Wanner 2010-11-19 15:12:26 Re: Latches with weak memory ordering (Re: max_wal_senders must die)
Previous Message Robert Haas 2010-11-19 15:05:03 Re: Latches with weak memory ordering (Re: max_wal_senders must die)