Re: slow startup due to LWLockAssign() spinlock - Mailing list pgsql-hackers

From Tom Lane
Subject Re: slow startup due to LWLockAssign() spinlock
Date
Msg-id 31001.1398351764@sss.pgh.pa.us
Whole thread Raw
In response to Re: slow startup due to LWLockAssign() spinlock  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: slow startup due to LWLockAssign() spinlock  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
> On 2014-04-24 15:56:45 +0300, Heikki Linnakangas wrote:
>> Another idea is to add an LWLockAssignBatch(int) function that assigns a
>> range of locks in one call. That would be very simple, and I think it would
>> be less likely to break things than a new global flag. I would be OK with
>> sneaking that into 9.4 still.

> I don't really see the advantage tbh. Assuming we always can avoid the
> spinlock initially seems simple enough - and I have significant doubts
> that anything but buffer locks will need enough locks that it matters
> for other users.

FWIW, I like the LWLockAssignBatch idea a lot better than the currently
proposed patch.  LWLockAssign is a low-level function that has no business
making risky assumptions about the context it's invoked in.

The other ideas are 9.5 material at this point, since they involve
research --- but I agree with Heikki that LWLockAssignBatch could be
snuck into 9.4 still.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Fabrízio de Royes Mello
Date:
Subject: Re: 9.4 Proposal: Initdb creates a single table
Next
From: Hannu Krosing
Date:
Subject: Re: 9.4 Proposal: Initdb creates a single table