projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
975ad4e
)
Move memory barrier in UnlockBufHdr to before releasing the lock.
author
Andres Freund
<andres@anarazel.de>
Mon, 30 May 2016 22:35:53 +0000
(15:35 -0700)
committer
Andres Freund
<andres@anarazel.de>
Mon, 30 May 2016 22:35:53 +0000
(15:35 -0700)
This bug appears to have been introduced late in the development of
48354581a4
("Allow Pin/UnpinBuffer to operate in a lockfree
manner.").
Found while debugging a bug which turned out to be independent of the
commit mentioned above.
Backpatch: -
src/include/storage/buf_internals.h
patch
|
blob
|
blame
|
history
diff --git
a/src/include/storage/buf_internals.h
b/src/include/storage/buf_internals.h
index c9cae956a541e40deaba299b854553a4cc8562e1..511d7409e6ef850794aaa09d47faf732daf26000 100644
(file)
--- a/
src/include/storage/buf_internals.h
+++ b/
src/include/storage/buf_internals.h
@@
-242,8
+242,8
@@
extern PGDLLIMPORT LWLockMinimallyPadded *BufferIOLWLockArray;
extern uint32 LockBufHdr(BufferDesc *desc);
#define UnlockBufHdr(desc, s) \
do { \
- pg_atomic_write_u32(&(desc)->state, (s) & (~BM_LOCKED)); \
pg_write_barrier(); \
+ pg_atomic_write_u32(&(desc)->state, (s) & (~BM_LOCKED)); \
} while (0)