aboutsummaryrefslogtreecommitdiff
path: root/src/include/postgres.h
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2016-04-13 15:28:29 -0700
committerAndres Freund <andres@anarazel.de>2016-04-13 15:28:29 -0700
commit6b93fcd149329d4ee7319561b30fc15a573c6307 (patch)
tree89ff94e710d7cbab57cd7262139cca220c562f06 /src/include/postgres.h
parent95ef43c4308102d23afa887c9fc28d9977612a2d (diff)
downloadpostgresql-6b93fcd149329d4ee7319561b30fc15a573c6307.tar.gz
postgresql-6b93fcd149329d4ee7319561b30fc15a573c6307.zip
Avoid atomic operation in MarkLocalBufferDirty().
The recent patch to make Pin/UnpinBuffer lockfree in the hot path (48354581a), accidentally used pg_atomic_fetch_or_u32() in MarkLocalBufferDirty(). Other code operating on local buffers was careful to only use pg_atomic_read/write_u32 which just read/write from memory; to avoid unnecessary overhead. On its own that'd just make MarkLocalBufferDirty() slightly less efficient, but in addition InitLocalBuffers() doesn't call pg_atomic_init_u32() - thus the spinlock fallback for the atomic operations isn't initialized. That in turn caused, as reported by Tom, buildfarm animal gaur to fail. As those errors are actually useful against this type of error, continue to omit - intentionally this time - initialization of the atomic variable. In addition, add an explicit note about only using pg_atomic_read/write on local buffers's state to BufferDesc's description. Reported-By: Tom Lane Discussion: 1881.1460431476@sss.pgh.pa.us
Diffstat (limited to 'src/include/postgres.h')
0 files changed, 0 insertions, 0 deletions