Re: Direct I/O - Mailing list pgsql-hackers

From Justin Pryzby
Subject Re: Direct I/O
Date
Msg-id 20221101133341.GX16921@telsasoft.com
Whole thread Raw
In response to Direct I/O  (Thomas Munro <thomas.munro@gmail.com>)
Responses Re: Direct I/O
List pgsql-hackers
On Tue, Nov 01, 2022 at 08:36:18PM +1300, Thomas Munro wrote:
> Hi,
> 
> Here is a patch to allow PostgreSQL to use $SUBJECT.  It is from the
> AIO patch-set[1].  It adds three new settings, defaulting to off:
> 
>   io_data_direct = whether to use O_DIRECT for main data files
>   io_wal_direct = ... for WAL
>   io_wal_init_direct = ... for WAL-file initialisation

You added 3 booleans, but I wonder if it's better to add a string GUC
which is parsed for comma separated strings.  (By "better", I mean
reducing the number of new GUCs - which is less important for developer
GUCs anyway.)

DIO is slower, but not so much that it can't run under CI.  I suggest to
add an 099 commit to enable the feature during development.

Note that this fails under linux with fsanitize=align:
../src/backend/storage/file/buffile.c:117:17: runtime error: member access within misaligned address 0x561a4a8e40f8 for
type'struct BufFile', which requires 4096 byte alignment
 

-- 
Justin



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Privileges on PUBLICATION
Next
From: "Jonathan S. Katz"
Date:
Subject: Re: heavily contended lwlocks with long wait queues scale badly