]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Use UnlockReleaseBuffer() in more places
authorAndres Freund <andres@anarazel.de>
Fri, 27 Mar 2026 19:27:04 +0000 (15:27 -0400)
committerAndres Freund <andres@anarazel.de>
Fri, 27 Mar 2026 19:56:29 +0000 (15:56 -0400)
commit8df3c48e466cfe8a1f9ccd3fb367244d4a47e94a
tree372b42c0dd12abb15f91d2a005722c89b163562f
parent41d3d64e87af3f16833b095032affe404443659b
Use UnlockReleaseBuffer() in more places

An upcoming commit will make UnlockReleaseBuffer() considerably faster and
more scalable than doing LockBuffer(BUFFER_LOCK_UNLOCK); ReleaseBuffer();. But
it's a small performance benefit even as-is.

Most of the callsites changed in this patch are not performance sensitive,
however some, like the nbtree ones, are in critical paths.

This patch changes all the easily convertible places over to
UnlockReleaseBuffer() mainly because I needed to check all of them anyway, and
reducing cases where the operations are done separately makes the checking
easier.

Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>
Discussion: https://postgr.es/m/5ubipyssiju5twkb7zgqwdr7q2vhpkpmuelxfpanetlk6ofnop@hvxb4g2amb2d
contrib/amcheck/verify_gin.c
contrib/pageinspect/rawpage.c
src/backend/access/heap/heapam.c
src/backend/access/heap/hio.c
src/backend/access/nbtree/nbtpage.c
src/backend/storage/buffer/bufmgr.c
src/backend/storage/freespace/freespace.c
src/test/modules/test_aio/test_aio.c