Re: AIO v2.5

From: Andres Freund <andres(at)anarazel(dot)de>
To: Antonin Houska <ah(at)cybertec(dot)at>
Cc: Noah Misch <noah(at)leadboat(dot)com>, pgsql-hackers(at)postgresql(dot)org, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>, Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
Subject: Re: AIO v2.5
Date: 2025-03-18 20:12:18
Message-ID: zp7obmaqdd6b5u2vhpw27hovpjirtqvjakkbkaz4vju7tohyul@4kfobe7ipgxm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Attached is v2.10, with the following changes:

- committed core AIO infrastructure patch

A few cosmetic changes

- committed io_method=worker

Two non-cosmetic changes:

- The shmem allocation functions over-estimated the amount of shared memory
required.

- pgaio_worker_shmem_init() should initialize up to MAX_IO_WORKERS, not just
io_workers, since the latter is intentionally PGC_SIGHUP (found by Thomas)

- Bunch of typo fixes found by searching for repeated words

Thomas found one and then I searched for more.

- Added Melanie's patch to allow effective_io_concurrency to be set on windows etc

- Fixed a reference to an outdated function reference (thanks to Bilal)

- Reordered patches to be a bit more in dependency order

E.g. "bufmgr: Implement AIO read support" doesn't depend on Thomas' "buffer
forwarding" patches and thus can be commited before those go in.

Next steps:

- Decide what to do about the smgr interrupt issue

I guess it could be deferred, based on the argument it only matters with a
sufficiently high debug level, but I don't feel comfortable with that.

I think it'd be reasonable to just go with the patch I sent on the other
thread (and included here).

- Get somebody to look at
"bufmgr: Improve stats when buffer was read in concurrently"

This arguably fixes a bug, or just weird behaviour, on master.

- Address the set_max_safe_fds() issue and once resolved, commit io_uring
method

Can happen concurrently with next steps

- Commit "aio: Implement support for reads in smgr/md/fd"

- Get somebody to do one more pass at bufmgr related commits, I think they
could use a less in-the-weeds eye.

That's the following commits:
- localbuf: Track pincount in BufferDesc as well
- bufmgr: Implement AIO read support
- bufmgr: Use AIO in StartReadBuffers()
- aio: Basic read_stream adjustments for real AIO

Questions / Unresolved:

- Write support isn't going to land in 18, but there is a tiny bit of code
regarding writes in the code for bufmgr IO. I guess I could move that to a
later commit?

I'm inclined to leave it, the structure of the code only really makes
knowing that it's going to be shared between reads & writes.

- pg_aios view name

Greetings,

Andres Freund

Attachment Content-Type Size
v2.10-0001-smgr-Hold-interrupts-in-most-smgr-functions.patch text/x-diff 10.2 KB
v2.10-0002-bufmgr-Improve-stats-when-buffer-is-read-in-co.patch text/x-diff 3.4 KB
v2.10-0003-aio-Add-liburing-dependency.patch text/x-diff 13.4 KB
v2.10-0004-aio-Add-io_method-io_uring.patch text/x-diff 20.2 KB
v2.10-0005-aio-Implement-support-for-reads-in-smgr-md-fd.patch text/x-diff 22.0 KB
v2.10-0006-aio-Add-README.md-explaining-higher-level-desi.patch text/x-diff 19.0 KB
v2.10-0007-localbuf-Track-pincount-in-BufferDesc-as-well.patch text/x-diff 4.5 KB
v2.10-0008-bufmgr-Implement-AIO-read-support.patch text/x-diff 25.3 KB
v2.10-0009-Support-buffer-forwarding-in-read_stream.c.patch text/x-diff 8.7 KB
v2.10-0010-Support-buffer-forwarding-in-StartReadBuffers.patch text/x-diff 10.5 KB
v2.10-0011-bufmgr-Use-AIO-in-StartReadBuffers.patch text/x-diff 27.0 KB
v2.10-0012-aio-Basic-read_stream-adjustments-for-real-AIO.patch text/x-diff 3.8 KB
v2.10-0013-docs-Reframe-track_io_timing-related-docs-as-w.patch text/x-diff 5.3 KB
v2.10-0014-Enable-IO-concurrency-on-all-systems.patch text/x-diff 11.0 KB
v2.10-0015-aio-Add-pg_aios-view.patch text/x-diff 9.8 KB
v2.10-0016-aio-Experimental-heuristics-to-increase-batchi.patch text/x-diff 1.6 KB
v2.10-0017-aio-Add-test_aio-module.patch text/x-diff 42.4 KB
v2.10-0018-aio-Implement-smgr-md-fd-write-support.patch text/x-diff 12.7 KB
v2.10-0019-aio-Add-bounce-buffers.patch text/x-diff 23.1 KB
v2.10-0020-bufmgr-Implement-AIO-write-support.patch text/x-diff 9.8 KB
v2.10-0021-aio-Add-IO-queue-helper.patch text/x-diff 7.4 KB
v2.10-0022-bufmgr-use-AIO-in-checkpointer-bgwriter.patch text/x-diff 31.1 KB
v2.10-0023-Ensure-a-resowner-exists-for-all-paths-that-ma.patch text/x-diff 2.6 KB
v2.10-0024-Temporary-Increase-BAS_BULKREAD-size.patch text/x-diff 1.3 KB
v2.10-0025-WIP-Use-MAP_POPULATE.patch text/x-diff 1.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gabriele Bartolini 2025-03-18 20:13:02 Re: Supporting TCP_SYNCNT in libpq
Previous Message Bruce Momjian 2025-03-18 20:08:22 Re: pgsql: Increase default maintenance_io_concurrency to 16