Re: Move PinBuffer and UnpinBuffer to atomics - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: Move PinBuffer and UnpinBuffer to atomics
Date
Msg-id CAPpHfdu4_+=vQuahoGCQb5-avHEUKTkzyq0GTD77FLjW0q3XVA@mail.gmail.com
Whole thread Raw
In response to Re: Move PinBuffer and UnpinBuffer to atomics  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Responses Re: Move PinBuffer and UnpinBuffer to atomics  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Re: Move PinBuffer and UnpinBuffer to atomics  (Jesper Pedersen <jesper.pedersen@redhat.com>)
List pgsql-hackers
On Thu, Sep 24, 2015 at 6:36 PM, Alexander Korotkov <a.korotkov@postgrespro.ru> wrote:
On Thu, Sep 24, 2015 at 6:32 PM, Andres Freund <andres@anarazel.de> wrote:
On 2015-09-15 20:16:10 +0300, YUriy Zhuravlev wrote:
> We will be tested.

Did you have a chance to run some benchmarks?
 
Yes, we now have 60 physical cores intel server and we're running benchmarks on it.

We got a consensus with Andres that we should commit the CAS version first and look to other optimizations.
Refactored version of atomic state patch is attached. The changes are following:
1) Macros are used for access refcount and usagecount.
2) likely/unlikely were removed. I think introducing of likely/unlikely should be a separate patch since it touches portability. Also, I didn't see any performance effect of this.
3) LockBufHdr returns the state after taking lock. Without using atomic increments it still can save some loops on skip atomic value reading.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company 
Attachment

pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: ALTER ... OWNER TO ... vs. ALTER DEFAULT PRIVILEGES
Next
From: Tom Lane
Date:
Subject: Re: planner doesn't use bitmap index