From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: bufmgr: Don't copy pages while writing out
Date: Fri, 27 Mar 2026 19:58:51 +0000
Message-ID: <E1w6DKV-001k0z-03@gemulon.postgresql.org> (raw)
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
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(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: andres@anarazel.de, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: bufmgr: Don't copy pages while writing out
In-Reply-To: <E1w6DKV-001k0z-03@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox