releaseOk and LWLockWaitForVar - Mailing list pgsql-hackers

From Andres Freund
Subject releaseOk and LWLockWaitForVar
Date
Msg-id 20140617121700.GB18143@awork2.anarazel.de
Whole thread Raw
Responses Re: releaseOk and LWLockWaitForVar  (Amit Kapila <amit.kapila16@gmail.com>)
Re: releaseOk and LWLockWaitForVar  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List 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



pgsql-hackers by date:

Previous
From: Abhijit Menon-Sen
Date:
Subject: [REVIEW] Re: Compression of full-page-writes
Next
From: Amit Kapila
Date:
Subject: Re: Wait free LW_SHARED acquisition - v0.2