Re: Non-reproducible AIO failure

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Nico Williams <nico(at)cryptonector(dot)com>
Cc: Konstantin Knizhnik <knizhnik(at)garret(dot)ru>, Alexander Lakhin <exclusion(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Daniel Gustafsson <daniel(at)yesql(dot)se>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, rmt(at)lists(dot)postgresql(dot)org
Subject: Re: Non-reproducible AIO failure
Date: 2025-08-25 02:41:18
Message-ID: CA+hUKGJHrNoO9N92rseOb2p9vQKLVTcJmadSxxrUFrjYHrnFXA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 25, 2025 at 1:52 PM Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
> > struct { PgAioHandleState v:8; } state;
>
> This preserves type safety and compiles to strb two properties we
> want, but it seems to waste space (look at the offsets for the
> stores):
>
> a.out[0x1000005f8] <+140>: ldr x8, [sp, #0x8]
> a.out[0x1000005fc] <+144>: strb wzr, [x8, #0x8]
> a.out[0x100000600] <+148>: ldr x8, [sp, #0x8]
> a.out[0x100000604] <+152>: strb wzr, [x8, #0x4]

Sorry, I didn't make that very clear: that's open source clang 17
compiling assignment of zero to two neighbouring wrapped bitfields
with your trick. Probably easier to look at the struct layout with
pahole or printf offsetof(...) or sizeof() to see that PgAioHandle
grows by 9 bytes of padding, something Andres obviously felt pretty
strongly about if he felt the need to summon bitfields...

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2025-08-25 02:42:35 Re: Non-reproducible AIO failure
Previous Message jian he 2025-08-25 02:22:15 Re: disallow alter individual column if partition key contains wholerow reference