Re: Wait free LW_SHARED acquisition - v0.2

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Wait free LW_SHARED acquisition - v0.2
Date: 2013-11-15 20:06:33
Message-ID: 20131115200633.GI5489@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2013-11-15 20:47:26 +0100, Andres Freund wrote:
> Hi,
>
> On 2013-09-27 00:55:45 +0200, Andres Freund wrote:
> > So what's todo? The file header tells us:
> > * - revive pure-spinlock implementation
> > * - abstract away atomic ops, we really only need a few.
> > * - CAS
> > * - LOCK XADD
> > * - convert PGPROC->lwWaitLink to ilist.h slist or even dlist.
> > * - remove LWLockWakeup dealing with MyProc
> > * - overhaul the mask offsets, make SHARED/EXCLUSIVE_LOCK_MASK wider, MAX_BACKENDS
>
> So, here's the next version of this patchset:
> 1) I've added an abstracted atomic ops implementation. Needs a fair
> amount of work, also submitted as a separate CF entry. (Patch 1 & 2)
> 2) I've converted PGPROC->lwWaiting into a dlist. That makes a fair bit
> of code easier to read and reduces the size of the patchset. Also
> fixes a bug in the xlog-scalability code. (Patch 3)
> 3) Alvaro and I updated the comments in lwlock.c. (Patch 4)
>
> I think 2) should be committable pretty soon. It's imo a pretty clear
> win in readability. 1) will need a good bit of more work.
>
> With regard to the scalable lwlock work, what's most needed now is a
> good amount of testing.
>
> Please note that you need to 'autoreconf' after applying the patchset. I
> don't have a compatible autoconf version on this computer causing the
> diff to be humongous if I include those changes.

Please also note that due to the current state of the atomics
implementation this likely will only work on a somewhat recent gcc and
that the performance might be slightly worse than in the previous
version because the atomic add is implemented using the CAS fallback.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-11-15 20:09:11 Re: REINDEX CONCURRENTLY 2.0
Previous Message Jeff Janes 2013-11-15 20:06:05 Re: Minmax indexes