From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Support direct I/O on macOS.
Date: Sun, 18 Jul 2021 23:58:58 +0000
Message-ID: <E1m5GgU-0003O0-Sj@gemulon.postgresql.org> (raw)
Support direct I/O on macOS.
Macs don't understand O_DIRECT, but they can disable caching with a
separate fcntl() call. Extend the file opening functions in fd.c to
handle this for us if the caller passes in PG_O_DIRECT.
For now, this affects only WAL data and even then only if you set:
max_wal_senders=0
wal_level=minimal
This is not expected to be very useful on its own, but later proposed
patches will make greater use of direct I/O, and it'll be useful for
testing if developers on Macs can see the effects.
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/CA%2BhUKG%2BADiyyHe0cun2wfT%2BSVnFVqNYPxoO6J9zcZkVO7%2BNGig%40mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/2dbe8905711ba09a2214b6e835f8f0c2c4981cb3
Modified Files
--------------
src/backend/storage/file/fd.c | 36 +++++++++++++++++++++++++++++++++++
src/bin/pg_test_fsync/pg_test_fsync.c | 35 ++++++++++++++++++++++++++++++----
src/include/access/xlogdefs.h | 15 ---------------
src/include/storage/fd.h | 16 ++++++++++++++++
4 files changed, 83 insertions(+), 19 deletions(-)
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: Support direct I/O on macOS.
In-Reply-To: <E1m5GgU-0003O0-Sj@gemulon.postgresql.org>
References: <E1m5GgU-0003O0-Sj@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