Re: XLogInsert scaling, revisited - Mailing list pgsql-hackers

From Andres Freund
Subject Re: XLogInsert scaling, revisited
Date
Msg-id 20130702171523.GA27409@awork2.anarazel.de
Whole thread Raw
In response to Re: XLogInsert scaling, revisited  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
On 2013-07-02 19:48:40 +0300, Heikki Linnakangas wrote:
> >If so, why isn't it sufficient to
> >initialize it in ReserveXLogInsertLocation?
> 
> It would be, but then ReserveXLogInsertLocation would need to hold the
> slot's spinlock at the same time with insertpos_lck, so that it could
> atomically read the current CurrBytePos value and copy it to
> xlogInsertingAt. It's important to keep ReserveXLogInsertLocation() as
> lightweight as possible, to maximize concurrency.

If you make it so that you always acquire the slot's spinlock first and
insertpos_lck after, the scalability shouldn't be any different from
now? Both the duration during which insertpos_lck is held and the
overall amount of atomic ops should be the same?

Greetings,

Andres Freund

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



pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Eliminating PD_ALL_VISIBLE, take 2
Next
From: Alvaro Herrera
Date:
Subject: Re: [GENERAL] Floating point error