Re: AIO v2.2

From: Andres Freund <andres(at)anarazel(dot)de>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: AIO v2.2
Date: 2025-01-13 21:46:13
Message-ID: 233uakf4dvzsogz3lexrcpnqwntracfxvgshfe4jxup3bk3x4l@t65xblacvy7u
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2025-01-13 15:43:46 -0500, Robert Haas wrote:
> On Wed, Jan 8, 2025 at 7:26 PM Andres Freund <andres(at)anarazel(dot)de> wrote:
> > 1) Shared memory representation of an IO, for the AIO subsystem internally
> >
> > Currently: PgAioHandle
> >
> > 2) A way for the issuer of an IO to reference 1), to attach information to the
> > IO
> >
> > Currently: PgAioHandle*
> >
> > 3) A way for any backend to wait for a specific IO to complete
> >
> > Currently: PgAioHandleRef
>
> With that additional information, I don't mind this naming too much,
> but I still think PgAioHandle -> PgAio and PgAioHandleRef ->
> PgAioHandle is worth considering. Compare BackgroundWorkerSlot and
> BackgroundWorkerHandle, which suggests PgAioHandle -> PgAioSlot and
> PgAioHandleRef -> PgAioHandle.

I don't love PgAioHandle -> PgAio as there are other things (e.g. per-backend
state) in the PgAio namespace...

> > > I do agree with Heikki that REAPED sounds later than COMPLETED, because you
> > > reap zombie processes by collecting their exit status. Maybe you could have
> > > AHS_COMPLETE or AHS_IO_COMPLETE for the state where the I/O is done but
> > > there's still completion-related work to be done, and then the other state
> > > could be AHS_DONE or AHS_FINISHED or AHS_FINAL or AHS_REAPED or something.
> >
> > How about
> >
> > AHS_COMPLETE_KERNEL or AHS_COMPLETE_RAW - raw syscall completed
> > AHS_COMPLETE_SHARED_CB - shared callback completed
> > AHS_COMPLETE_LOCAL_CB - local callback completed
> >
> > ?
>
> That's not bad. I like RAW better than KERNEL.

Cool.

> I was hoping to use different works like COMPLETE and DONE rather than, as
> you did it here, COMPLETE and COMPLETE, but it's probably fine.

Once the IO is really done, the handle is immediately recycled (and moved into
IDLE state, ready to be used again).

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2025-01-13 21:46:47 Re: Eagerly scan all-visible pages to amortize aggressive vacuum
Previous Message Masahiko Sawada 2025-01-13 21:45:15 Re: POC: enable logical decoding when wal_level = 'replica' without a server restart