bufmgr: Change BufferDesc.state to be a 64-bit atomic
Andres Freund <andres@anarazel.de>
bufmgr: Change BufferDesc.state to be a 64-bit atomic This is motivated by wanting to merge buffer content locks into BufferDesc.state in a future commit, rather than having a separate lwlock (see commit c75ebc657ff for more details). As this change is rather mechanical, it seems to make sense to split it out into a separate commit, for easier review. Reviewed-by: Melanie Plageman <melanieplageman@gmail.com> Reviewed-by: Chao Li <li.evan.chao@gmail.com> Discussion: https://postgr.es/m/fvfmkr5kk4nyex56ejgxj3uzi63isfxovp2biecb4bspbjrze7@az2pljabhnff
Files
| Path | Change | +/− |
|---|---|---|
| contrib/pg_buffercache/pg_buffercache_pages.c | modified | +4 −4 |
| contrib/pg_prewarm/autoprewarm.c | modified | +1 −1 |
| src/backend/storage/buffer/buf_init.c | modified | +1 −1 |
| src/backend/storage/buffer/bufmgr.c | modified | +85 −85 |
| src/backend/storage/buffer/freelist.c | modified | +12 −12 |
| src/backend/storage/buffer/localbuf.c | modified | +36 −36 |
| src/include/storage/buf_internals.h | modified | +27 −24 |
| src/include/storage/procnumber.h | modified | +7 −7 |
| src/test/modules/test_aio/test_aio.c | modified | +6 −6 |
Discussion
- Buffer locking is special (hints, checksums, AIO writes) 120 messages · 2025-08-22 → 2026-04-03