From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: PGPROC alignment (was Re: pgsql: Separate RecoveryConflictReasons from procsignals)
Date: Mon, 16 Mar 2026 15:52:59 +0000
Message-ID: <abgnW1+SVM2xFcCF@ip-10-97-1-34.eu-west-3.compute.internal> (raw)
In-Reply-To: <abfmoxoyep5jLnIc@ip-10-97-1-34.eu-west-3.compute.internal>
References: <aYuDz2kvi7haNORb@ip-10-97-1-34.eu-west-3.compute.internal>
<aYuIrKbh1kW36xbc@alap3.anarazel.de>
<3dd6f70c-b94d-4428-8e75-74a7136396be@iki.fi>
<aYwISFVCAJon5ZxT@ip-10-97-1-34.eu-west-3.compute.internal>
<787be980-0878-4f4a-be01-d042ab5d370e@iki.fi>
<aY7auF2/xuT58vRI@ip-10-97-1-34.eu-west-3.compute.internal>
<d7a788fa-e609-4894-a8be-2f70e135424f@eisentraut.org>
<aZ2LS5m1K2G3r3U4@ip-10-97-1-34.eu-west-3.compute.internal>
<3ff35999-7a1e-40fa-938c-f2bff85e2e2f@eisentraut.org>
<abfmoxoyep5jLnIc@ip-10-97-1-34.eu-west-3.compute.internal>
Hi,
On Mon, Mar 16, 2026 at 11:16:51AM +0000, Bertrand Drouvot wrote:
> Hi,
>
> On Mon, Mar 16, 2026 at 11:42:35AM +0100, Peter Eisentraut wrote:
> > On 24.02.26 12:28, Bertrand Drouvot wrote:
> > > > You can/should use C11 standard alignas(), so you don't need to worry about
> > > > whether it's supported or not.
> > >
> > > Oh right, I did not notice 300c8f53247 and following like e7075a3405c, d4c0f91f7d5
> > > and 97e04c74bed.
> > >
> > > PFA, 0001 doing so for PGPROC and PgAioUringContext. As those are typedef,
> > > the patch puts alignas within the struct.
> > >
> > > For PGPROC at the start of the struct, I think that placing it on the first member
> > > is the right location because it ensures the whole struct is aligned to PG_CACHE_LINE_SIZE
> > > without adding padding before this member. For example if I set it on backendType,
> > > then it adds 100 bytes of padding and the struct is obviously still a multiple of
> > > PG_CACHE_LINE_SIZE but is now 1024 bytes (instead of 896).
> > >
> > > For PgAioUringContext at completion_lock (like suggested by Andres in [1]), which
> > > is also the start of the struct.
> > >
> > > I checked and the padding for those are exactly the same after the changes.
> >
> > I have committed the 0001 patch.
>
> Thanks! I don't know why but I don't see it in https://git.postgresql.org/gitweb/?p=postgresql.git;a=summary,
> or in the github repo though.
FWIW, I reached out to sysadmins@ and it has now been fixed.
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: bertranddrouvot.pg@gmail.com, peter@eisentraut.org, hlinnaka@iki.fi, andres@anarazel.de, pgsql-hackers@postgresql.org
Subject: Re: PGPROC alignment (was Re: pgsql: Separate RecoveryConflictReasons from procsignals)
In-Reply-To: <abgnW1+SVM2xFcCF@ip-10-97-1-34.eu-west-3.compute.internal>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox