releaseOk and LWLockWaitForVar

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: heikki(at)anarazel(dot)de, pgsql-hackers(at)postgresql(dot)org
Subject: releaseOk and LWLockWaitForVar
Date: 2014-06-17 12:17:00
Message-ID: 20140617121700.GB18143@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Heikki, All,

Amit just pointed me to a case where the lwlock scalability patch
apparently causes problems and I went on to review it and came across
the following problem in 9.4/master:
LWLockWaitForVar() doesn't set releaseOk to true when waiting
again. Isn't that a bug? What if there's another locker coming in after
LWLockWaitForVar() returns from the PGSemaphoreLock() but before it has
acquire the spinlock? Now, it might be that it's unproblematic because
of hte specific way these locks are used right now, but it doesn't seem
like a good idea to leave it that way.

Greetings,

Andres Freund

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2014-06-17 12:31:58 Re: Wait free LW_SHARED acquisition - v0.2
Previous Message Abhijit Menon-Sen 2014-06-17 11:47:13 [REVIEW] Re: Compression of full-page-writes