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

From Merlin Moncure
Subject Re: Move PinBuffer and UnpinBuffer to atomics
Date
Msg-id CAHyXU0xxsGb1Q6ZQR84Y8Oauq-Tyu-ZeQWujQ1RBJu+jM6b1WA@mail.gmail.com
Whole thread Raw
In response to Re: Move PinBuffer and UnpinBuffer to atomics  (Andres Freund <andres@anarazel.de>)
Responses Re: Move PinBuffer and UnpinBuffer to atomics  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Mon, Sep 14, 2015 at 9:06 PM, Andres Freund <andres@anarazel.de> wrote:
> On 2015-09-14 17:41:42 +0200, Andres Freund wrote:
>> I pointed out how you can actually make this safely lock-free giving you
>> the interesting code.
>
> And here's an actual implementation of that approach. It's definitely
> work-in-progress and could easily be optimized further. Don't have any
> big machines to play around with right now tho.

Are you confident this is faster across all workloads?   Pin/Unpin are
probably faster but this comes at a cost of extra atomic ops during
the clock sweep loop.  I wonder if this will degrade results under
heavy contention.

Also, I'm curious about your introduction of __builtin_expect()
macros.  Did you measure any gain from them?  I bet there are other
places they could be used -- for example the mvcc hint bit checks on
xmin.

merlin



pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: Can extension build own SGML document?
Next
From: Jim Nasby
Date:
Subject: Re: Multi-tenancy with RLS