Re: Wait free LW_SHARED acquisition - v0.10

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Wait free LW_SHARED acquisition - v0.10
Date: 2014-12-23 19:11:08
Message-ID: 20141223191108.GB23613@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Attached is a new version of the patchset which I intend to commit soon.

Stuff changed since 0.9:

* Greatly simplified locking logic - the whole concept that a lock could
be spuriously acquired is gone. That cost a small bit of performance
(0.5%, I thought it'd be much bigger) on x86, but is a noticeable
performance *benefit* on PPC.

* releaseOK (and other internal flags) are rolled into the former
'lockcount' variable which is now named state. By having it inside the
same atomic reasoning about the state gets easier as there's no skew
between observing the lockcount and other variables.

* The number of queued waiters isn't required anymore, it's only a
debugging aid (#ifdef LOCK_DEBUG) at this point.

Patches:
0001: errhidecontext() patch
0002: dlist()ify lwWaitLink
0003: LW_SHARED scalability

I've done a fair amount of benchmarking and on bigger system the new
code seems to be a win pretty much generally.

Greetings,

Andres Freund

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

Attachment Content-Type Size
0001-Add-capability-to-suppress-CONTEXT-messages-to-elog-.patch text/x-patch 2.9 KB
0002-Convert-the-PGPROC-lwWaitLink-list-into-a-dlist-inst.patch text/x-patch 11.0 KB
0003-Wait-free-LW_SHARED-LWLock-acquisition.patch text/x-patch 40.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2014-12-23 19:25:35 Commit timestamp abbreviations
Previous Message Stephen Frost 2014-12-23 19:05:14 Re: Proposal: two new role attributes and/or capabilities?