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 19:47:26
Message-ID: 20131115194725.GG5489@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
0001-Try-to-make-HP-UX-s-ac-not-cause-warnings-about-unus.patch text/x-patch 722 bytes
0002-Very-basic-atomic-ops-implementation.patch text/x-patch 98.4 KB
0003-Convert-the-PGPROC-lwWaitLink-list-into-a-dlist-inst.patch text/x-patch 14.7 KB
0004-Wait-free-LW_SHARED-lwlock-acquiration.patch text/x-patch 30.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Kreen 2013-11-15 19:49:51 Re: Review:Patch: SSL: prefer server cipher order
Previous Message Alexander Korotkov 2013-11-15 19:42:19 Re: GIN improvements part2: fast scan