Hi,
On 2026-01-13 10:05:02 -0500, Melanie Plageman wrote:
> On Mon, Jan 12, 2026 at 7:33 PM Andres Freund <andres@anarazel.de> wrote:
> >
> > - added a commit that renames ResOwnerReleaseBufferPin to
> > ResOwnerReleaseBuffer (et al), as it now also releases content locks if held
> >
> > I kept this separate as I'm not yet sure about the new name, partially due
> > to there also being a "buffer io" resowner. I tried "buffer ownership" for
> > the resowner that tracks pins and locks, but that was long and not clearly
> > better.
>
> I didn't look at the patch but I strongly agree that
> ResOwnerReleaseBufferPin() should not also release locks, so it should
> have a new name.
OK.
> Ironic that ResOwnerReleaseBufferIO() releases pins and not locks.
Not sure I follow? I don't think it releases pins? And why should it release
locks?
> What about ResOwnerReleaseBufferClaim() or
> ResOwnerReleaseBufferAccess() or ResOwnerReleaseBufferHold()?
I'm inclined to go with just ResOwnerReleaseBuffer() at the moment. Buffer IO
kind of is a subsidiary thing, and it requires holding a pin as well, so it
doesn't feel too wrong.
I also wonder if we could merge BufferIO into the private refcount
infrastructure, similar to how the patches store the lockmode in the private
refcount. The separate resowner acquisition does show up in profiles when
reading from the kernel page cache, so that'd be a nice (but small)
improvement.
Greetings,
Andres Freund