Re: Spinlocks and semaphores in 9.2 and 9.3 - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Spinlocks and semaphores in 9.2 and 9.3
Date
Msg-id CA+Tgmoafx=ij5PELTaBXNFxCQVixQPEy8OzwJPWuuTHv+36Njg@mail.gmail.com
Whole thread Raw
In response to Re: Spinlocks and semaphores in 9.2 and 9.3  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Apr 18, 2016 at 11:24 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Andres Freund <andres@anarazel.de> writes:
>> On 2016-04-18 11:07:08 -0400, Tom Lane wrote:
>>> Did you want to actually review this patch, or should I just push it?
>
>> No, I'm good, you should push it. I did a quick scan of the patch, and
>> it looks sane. For a second I was concerned that there might be a
>> situation in which this patch increases the total number of semaphore
>> needed, which might make backpatching a bit problematic - but it appears
>> that that'd be a very absurd configuration.
>
> I was actually wondering whether it'd make sense to cut the number of
> underlying semaphores to 128 or 512 or thereabouts.  But I think we had
> that discussion when the daa7527afc227443 patch went in to begin with,
> and convinced ourselves that 1024 was okay.  Robert, do you recall the
> reasoning?

I don't recall a specific discussion about it, but the number we would
have needed before was gigantic - one per lwlock, which is typically
going to be far more than 1024.  I mean, at shared_buffers=32MB, there
are 4096 buffers using two lwlocks each... never mind everything else
that uses lwlocks.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Spinlocks and semaphores in 9.2 and 9.3
Next
From: Aleksander Alekseev
Date:
Subject: Re: Should we remove unused code?