Replace buffer I/O locks with condition variables.

1.  Backends waiting for buffer I/O are now interruptible.

2.  If something goes wrong in a backend that is currently performing
I/O, waiting backends no longer wake up until that backend reaches
AbortBufferIO() and broadcasts on the CV.  Previously, any waiters would
wake up (because the I/O lock was automatically released) and then
busy-loop until AbortBufferIO() cleared BM_IO_IN_PROGRESS.

3.  LWLockMinimallyPadded is removed, as it would now be unused.

Author: Robert Haas <[email protected]>
Reviewed-by: Thomas Munro <[email protected]>
Reviewed-by: Julien Rouhaud <[email protected]>
Reviewed-by: Tom Lane <[email protected]> (earlier version, 2016)
Discussion: 
https://postgr.es/m/CA%2BhUKGJ8nBFrjLuCTuqKN0pd2PQOwj9b_jnsiGFFMDvUxahj_A%40mail.gmail.com
Discussion: 
https://postgr.es/m/CA+Tgmoaj2aPti0yho7FeEf2qt-JgQPRWb0gci_o1Hfr=c56...@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d87251048a0f293ad20cc1fe26ce9f542de105e6

Modified Files
--------------
doc/src/sgml/monitoring.sgml             |  8 ++--
src/backend/postmaster/pgstat.c          |  3 ++
src/backend/storage/buffer/README        | 13 +++----
src/backend/storage/buffer/buf_init.c    | 34 +++++++----------
src/backend/storage/buffer/bufmgr.c      | 64 +++++++++-----------------------
src/backend/storage/lmgr/lwlock.c        |  5 +--
src/include/pgstat.h                     |  1 +
src/include/storage/buf_internals.h      |  8 ++--
src/include/storage/condition_variable.h | 11 ++++++
src/include/storage/lwlock.h             | 29 ---------------
src/tools/pgindent/typedefs.list         |  1 +
11 files changed, 61 insertions(+), 116 deletions(-)

Reply via email to