postgresql/src/backend/access
Alvaro Herrera ee1cbe806d
Operate XLogCtl->log{Write,Flush}Result with atomics
This removes the need to hold both the info_lck spinlock and
WALWriteLock to update them.  We use stock atomic write instead, with
WALWriteLock held.  Readers can use atomic read, without any locking.

This allows for some code to be reordered: some places were a bit
contorted to avoid repeated spinlock acquisition, but that's no longer a
concern, so we can turn them to more natural coding.  Some further
changes are possible (maybe to performance wins), but in this commit I
did rather minimal ones only, to avoid increasing the blast radius.

Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Reviewed-by: Jeff Davis <pgsql@j-davis.com>
Reviewed-by: Andres Freund <andres@anarazel.de> (earlier versions)
Discussion: https://postgr.es/m/20200831182156.GA3983@alvherre.pgsql
2024-04-05 16:14:39 +02:00
..
brin Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
common Invent SERIALIZE option for EXPLAIN. 2024-04-03 17:41:57 -04:00
gin Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
gist Merge prune, freeze and vacuum WAL record formats 2024-03-25 14:59:58 +02:00
hash Merge prune, freeze and vacuum WAL record formats 2024-03-25 14:59:58 +02:00
heap Secondary refactor of heap scanning functions 2024-04-04 19:22:45 +13:00
index Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
nbtree Fix an oversight in refactoring in 06b10f80ba. 2024-03-22 15:25:53 +02:00
rmgrdesc Merge prune, freeze and vacuum WAL record formats 2024-03-25 14:59:58 +02:00
sequence Fix comment thinko in sequence.c 2024-02-27 08:19:39 +09:00
spgist Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
table Revert "Custom reloptions for table AM" 2024-04-02 11:29:00 +03:00
tablesample Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
transam Operate XLogCtl->log{Write,Flush}Result with atomics 2024-04-05 16:14:39 +02:00
Makefile Introduce sequence_*() access functions 2024-02-26 16:04:59 +09:00
meson.build Introduce sequence_*() access functions 2024-02-26 16:04:59 +09:00