bufmgr: Don't copy pages while writing out
Andres Freund <andres@anarazel.de>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/hash/hashpage.c | modified | +1 −1 |
| src/backend/access/transam/xloginsert.c | modified | +9 −36 |
| src/backend/storage/buffer/bufmgr.c | modified | +3 −11 |
| src/backend/storage/buffer/localbuf.c | modified | +1 −1 |
| src/backend/storage/page/bufpage.c | modified | +9 −42 |
| src/backend/storage/smgr/bulk_write.c | modified | +1 −1 |
| src/include/storage/bufpage.h | modified | +1 −2 |
| src/test/modules/test_aio/test_aio.c | modified | +1 −1 |
Discussion
- Buffer locking is special (hints, checksums, AIO writes) 120 messages · 2025-08-22 → 2026-04-03