pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Replace buffer I/O locks with condition variables.
Date: Wed, 10 Mar 2021 21:46:28 +0000
Message-ID: <E1lK6ey-0003uX-Gk@gemulon.postgresql.org> (raw)

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 <robertmhaas@gmail.com>
Reviewed-by: Thomas Munro <thomas.munro@gmail.com>
Reviewed-by: Julien Rouhaud <rjuju123@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> (earlier version, 2016)
Discussion: https://postgr.es/m/CA%2BhUKGJ8nBFrjLuCTuqKN0pd2PQOwj9b_jnsiGFFMDvUxahj_A%40mail.gmail.com
Discussion: https://postgr.es/m/CA+Tgmoaj2aPti0yho7FeEf2qt-JgQPRWb0gci_o1Hfr=C56Xng@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(-)



Message-ID: <E1lK6ey-0003uX-Gk@gemulon.postgresql.org>
Permalink:  ../E1lK6ey-0003uX-Gk@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lK6ey-0003uX-Gk@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tmunro@postgresql.org
  Subject: Re: pgsql: Replace buffer I/O locks with condition variables.
  In-Reply-To: <E1lK6ey-0003uX-Gk@gemulon.postgresql.org>
  References: <E1lK6ey-0003uX-Gk@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox