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