Re: Spinlocks and compiler/memory barriers

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Spinlocks and compiler/memory barriers
Date: 2014-09-25 13:25:16
Message-ID: CA+TgmoZ84uKiXavZ2PaGL-mkqsoZh0Ft2uNMKdXdRDFo0nZxGw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 24, 2014 at 2:45 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> On 2014-09-09 17:54:03 -0400, Robert Haas wrote:
>> So, that's committed, then. I think we should pick something that uses
>> spinlocks and is likely to fail spectacularly if we haven't got this
>> totally right yet, and de-volatilize it. And then watch to see what
>> turns red in the buildfarm and/or which users start screaming. I'm
>> inclined to propose lwlock.c as a candidate, since that's very widely
>> used and a place where we know there's significant contention.
>
> Did you consider removing the volatiles from bufmgr.c? There's lots of
> volatiles in there and most of them don't seem to have been added in a
> principled way. I'm looking at my old patch for lockless pin/unpin of
> buffers and it'd look a lot cleaner without.

I hadn't thought of it, but it sounds like a good idea.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Johnston 2014-09-25 13:32:17 Re: proposal: rounding up time value less than its unit.
Previous Message Gregory Smith 2014-09-25 13:18:19 Re: add modulo (%) operator to pgbench