Re: [HACKERS] PinBuffer() no longer makes use of strategy - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [HACKERS] PinBuffer() no longer makes use of strategy
Date
Msg-id 20170204003924.pjj5xpkkyo5lhosk@alap3.anarazel.de
Whole thread Raw
In response to [HACKERS] PinBuffer() no longer makes use of strategy  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Responses Re: [HACKERS] PinBuffer() no longer makes use of strategy  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List 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



pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: [HACKERS] PinBuffer() no longer makes use of strategy
Next
From: Jim Nasby
Date:
Subject: Re: \if, \elseif, \else, \endif (was Re: [HACKERS] PSQL commands:\quit_if, \quit_unless)