Re: Lockless StrategyGetBuffer() clock sweep

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Lockless StrategyGetBuffer() clock sweep
Date: 2014-12-23 21:51:40
Message-ID: 20141223215140.GG23613@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-12-23 16:42:41 -0500, Robert Haas wrote:
> I don't think I have anything to say about the substance of the patch.
> If fetch-and-add is faster than a spinlock cycle, then it is. And
> it's good to be fast.

I don't think the primary advantage is that it's fast (even though it
should be as fast as a single TAS on x86). It's that you can never sleep
while holding the spinlock when there's no such spinlock and that
everytime you transfer the cacheline from another cpu to you you'll also
make progress...

Will fix the other stuff.

Greetings,

Andres Freund

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Karlsson 2014-12-23 23:41:13 Re: Using 128-bit integers for sum, avg and statistics aggregates
Previous Message Robert Haas 2014-12-23 21:42:41 Re: Lockless StrategyGetBuffer() clock sweep