pgsql: bufmgr: Don't copy pages while writing out

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: bufmgr: Don't copy pages while writing out
Date: 2026-03-27 19:58:51
Message-ID: E1w6DKV-001k0z-03@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)gmail(dot)com>
Discussion: https://postgr.es/m/5ubipyssiju5twkb7zgqwdr7q2vhpkpmuelxfpanetlk6ofnop@hvxb4g2amb2d

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/41d3d64e87af3f16833b095032affe404443659b

Modified Files
--------------
src/backend/access/hash/hashpage.c | 2 +-
src/backend/access/transam/xloginsert.c | 45 ++++++-----------------------
src/backend/storage/buffer/bufmgr.c | 14 ++-------
src/backend/storage/buffer/localbuf.c | 2 +-
src/backend/storage/page/bufpage.c | 51 ++++++---------------------------
src/backend/storage/smgr/bulk_write.c | 2 +-
src/include/storage/bufpage.h | 3 +-
src/test/modules/test_aio/test_aio.c | 2 +-
8 files changed, 26 insertions(+), 95 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2026-03-27 21:41:19 pgsql: Doc: split functions-posix-regexp section into multiple subsecti
Previous Message Tom Lane 2026-03-27 19:39:04 pgsql: pgindent: ensure all C files end with a newline.