]> git.ipfire.org Git - thirdparty/postgresql.git/commit
bufmgr: Don't copy pages while writing out
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)
commit41d3d64e87af3f16833b095032affe404443659b
treedfc1ee1d77f01f332580efdc6b468edde4d6d28e
parent79ac82125ef6608b8a1c7e089eea17476537467c
bufmgr: Don't copy pages while writing out

After the series of preceding commits introducing and using
BufferBeginSetHintBits()/BufferSetHintBits16(), hint bits are not set anymore
while IO is going on. Therefore we do not need to copy pages while they are
being written out anymore.

For the same reason XLogSaveBufferForHint() now does not need to operate on a
copy of the page anymore, but can instead use the normal XLogRegisterBuffer()
mechanism. For that the assertions and comments to XLogRegisterBuffer() had to
be updated to allow share-exclusive locked buffers to be registered.

Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>
Discussion: https://postgr.es/m/5ubipyssiju5twkb7zgqwdr7q2vhpkpmuelxfpanetlk6ofnop@hvxb4g2amb2d
src/backend/access/hash/hashpage.c
src/backend/access/transam/xloginsert.c
src/backend/storage/buffer/bufmgr.c
src/backend/storage/buffer/localbuf.c
src/backend/storage/page/bufpage.c
src/backend/storage/smgr/bulk_write.c
src/include/storage/bufpage.h
src/test/modules/test_aio/test_aio.c