Re: PinBuffer() no longer makes use of strategy

From: Andres Freund <andres(at)anarazel(dot)de>
To: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)2ndquadrant(dot)com>
Subject: Re: PinBuffer() no longer makes use of strategy
Date: 2017-02-04 00:39:24
Message-ID: 20170204003924.pjj5xpkkyo5lhosk@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2017-02-03 18:32:03 -0600, Jim Nasby wrote:
> Commit 48354581a49c30f5757c203415aa8412d85b0f70 (Allow Pin/UnpinBuffer to
> operate in a lockfree manner) removed the code in PinBuffer that
> conditionally incremented usage_count when a ring buffer was in use. Was
> that intentional? ISTM the old behavior should have been retained.

Hm. You mean the else in
if (strategy == NULL)
{
if (buf->usage_count < BM_MAX_USAGE_COUNT)
buf->usage_count++;
}
else
{
if (buf->usage_count == 0)
buf->usage_count = 1;
}
(Not sure what you exactly mean with "conditionally increment")?

I don't really recall - I suspect it wasn't (otherwise we'd have had to
update the function's comment and remove the arguument). Alexander? I
suspect I'd skipped implementing it in my prototype and when finishing
the patch Alexander didn't see that part.

I have a hard time believing it makes any sort of meaningful difference
though - you see one?

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2017-02-04 00:42:18 Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)
Previous Message Jim Nasby 2017-02-04 00:32:03 PinBuffer() no longer makes use of strategy