Re: Spinlocks and semaphores in 9.2 and 9.3

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Spinlocks and semaphores in 9.2 and 9.3
Date: 2016-04-18 15:35:05
Message-ID: CA+Tgmoafx=ij5PELTaBXNFxCQVixQPEy8OzwJPWuuTHv+36Njg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Apr 18, 2016 at 11:24 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Andres Freund <andres(at)anarazel(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2016-04-18 15:37:51 Re: Should we remove unused code?
Previous Message Tom Lane 2016-04-18 15:34:51 Re: Spinlocks and semaphores in 9.2 and 9.3