On Sun, Feb 25, 2024 at 11:16 AM Thomas Munro <thomas.mu...@gmail.com> wrote:
> On Sun, Feb 25, 2024 at 11:06 AM Heikki Linnakangas <hlinn...@iki.fi> wrote:
> > Regarding the issue at hand, perhaps we should define PG_IO_ALIGN_SIZE as 
> > 16 on AIX, if that's the best the linker can do on that platform.
>
> You'll probably get either an error or silently fall back to buffered
> I/O, if direct I/O is enabled and you try to read/write a badly
> aligned buffer.  That's documented (they offer finfo() to query it,
> but it's always 4KB for the same sort of reasons as it is on every
> other OS).

I guess it's the latter ("to work efficiently" sounds like it isn't
going to reject the request):

https://www.ibm.com/docs/en/aix/7.3?topic=tuning-direct-io

If you make it < 4KB then all direct I/O would be affected, not just
this one place, so then you might as well just not allow direct I/O on
AIX at all, to avoid giving a false impression that it does something.
(Note that if we think the platform lacks O_DIRECT we don't make those
assertions about alignment).

FWIW I'm aware of one other thing that is wrong with our direct I/O
support on AIX: it should perhaps be using a different flag.  I
created a wiki page to defer thinking about any AIX issues
until/unless at least one real, live user shows up, which hasn't
happened yet:  https://wiki.postgresql.org/wiki/AIX


Reply via email to