Re: Buffer locking is special (hints, checksums, AIO writes)

From: Andres Freund <andres(at)anarazel(dot)de>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Melanie Plageman <melanieplageman(at)gmail(dot)com>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Noah Misch <noah(at)leadboat(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Subject: Re: Buffer locking is special (hints, checksums, AIO writes)
Date: 2026-01-13 00:33:56
Message-ID: jtg5cu4n6h5lib3kzx66ju4yhh6kmviaud7oq6dtut6c4q4rdi@xwsfoagt3c2b
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2026-01-12 12:45:03 -0500, Andres Freund wrote:
> I'm doing another pass through 0003 and will push that if I don't find
> anything significant.

Done, after adjust two comments in minor ways.

> Also working on doing comment polishing of the later patches, found a few
> things, but not quite enough to be worth reposting yet.

Here are the remaining commits, with a bit of polish:

- fixed references to old names in some places (lwlocks, release_ok)

- Aded an assert that we don't already hold a lock in BufferLockConditional()

- typo and grammar fixes

- updated the commit message of the LW_FLAG_RELEASE_OK, as "requested" by
Melanie. I hope this explains the situation better.

- 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.

Greetings,

Andres Freund

Attachment Content-Type Size
v10-0001-lwlock-Invert-meaning-of-LW_FLAG_RELEASE_OK.patch text/x-diff 5.7 KB
v10-0002-bufmgr-Make-definitions-related-to-buffer-descri.patch text/x-diff 4.5 KB
v10-0003-bufmgr-Change-BufferDesc.state-to-be-a-64-bit-at.patch text/x-diff 45.1 KB
v10-0004-bufmgr-Implement-buffer-content-locks-independen.patch text/x-diff 47.0 KB
v10-0005-Require-share-exclusive-lock-to-set-hint-bits-an.patch text/x-diff 39.6 KB
v10-0006-WIP-Make-UnlockReleaseBuffer-more-efficient.patch text/x-diff 3.5 KB
v10-0007-WIP-bufmgr-Don-t-copy-pages-while-writing-out.patch text/x-diff 11.6 KB
v10-0008-WIP-bufmgr-Rename-ResOwnerReleaseBufferPin.patch text/x-diff 3.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2026-01-13 00:51:09 Re: Adding basic NUMA awareness
Previous Message Andres Freund 2026-01-13 00:24:34 Re: Adding basic NUMA awareness