Re: Wait free LW_SHARED acquisition - v0.2 - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Wait free LW_SHARED acquisition - v0.2
Date
Msg-id 20131115194725.GG5489@awork2.anarazel.de
Whole thread Raw
In response to Wait free LW_SHARED acquisition  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: Wait free LW_SHARED acquisition - v0.2  (Andres Freund <andres@2ndquadrant.com>)
Re: Wait free LW_SHARED acquisition - v0.2  (Peter Eisentraut <peter_e@gmx.net>)
Re: Wait free LW_SHARED acquisition - v0.2  (Peter Eisentraut <peter_e@gmx.net>)
Re: Wait free LW_SHARED acquisition - v0.2  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
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.

Greetings,

Andres Freund

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

Attachment

pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: GIN improvements part2: fast scan
Next
From: Marko Kreen
Date:
Subject: Re: Review:Patch: SSL: prefer server cipher order