Re: Allow io_combine_limit up to 1MB

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Tomas Vondra <tomas(at)vondra(dot)me>
Subject: Re: Allow io_combine_limit up to 1MB
Date: 2025-03-18 03:18:17
Message-ID: CA+hUKGKd=U1zSFYNjwBBrXV3NsqR2U8dCUrCBVeB0DQ8Vb8Dwg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Here's a new version that also adjusts the code that just landed in da722699:

- /*
- * Each IO handle can have an PG_IOV_MAX long iovec.
- *
- * XXX: Right now the amount of space available for each IO is
PG_IOV_MAX.
- * While it's tempting to use the io_combine_limit GUC, that's
- * PGC_USERSET, so we can't allocate shared memory based on that.
- */
+ /* each IO handle can have up to io_max_combine_limit iovec objects */
return mul_size(sizeof(struct iovec),
- mul_size(mul_size(PG_IOV_MAX,
AioProcs()),
+
mul_size(mul_size(io_max_combine_limit, AioProcs()),
io_max_concurrency));

While doing that, this juxtaposition jumped out at me:

+ uint32 per_backend_iovecs = io_max_concurrency *
max_io_combine_limit;

Surely one of these names has to give! First commit wins, so the new
name in this version is "io_max_combine_limit".

I was contemplating making the same change to the MAX_IO_COMBINE_LIMIT
macro when it occurred to me that we could just delete it. It has few
references and they could just use PG_IOV_MAX instead; it's perhaps a
little less clear as names go, but it's also pretty confusing that
there's a macro with the same name as a GUC...

Attachment Content-Type Size
v4-0001-Introduce-io_max_combine_limit.patch text/x-patch 9.9 KB
v4-0002-Increase-the-maximum-I-O-combine-size-to-1MB.patch text/x-patch 5.8 KB
v4-0003-Remove-MAX_IO_COMBINE_LIMIT-macro.patch text/x-patch 2.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2025-03-18 03:19:22 Re: Fix couple of typos
Previous Message Robert Haas 2025-03-18 03:02:14 Re: pgsql: pg_upgrade: Preserve default char signedness value from old clus