Re: PGPROC alignment (was Re: pgsql: Separate RecoveryConflictReasons from procsignals)

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PGPROC alignment (was Re: pgsql: Separate RecoveryConflictReasons from procsignals)
Date: 2026-02-22 11:15:03
Message-ID: f7d3fd76-330f-488b-8f2e-722796127ae0@iki.fi
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 21/02/2026 11:42, Bertrand Drouvot wrote:
> On Fri, Feb 20, 2026 at 11:03:09PM +0200, Heikki Linnakangas wrote:
>> On 11/02/2026 06:40, Bertrand Drouvot wrote:
>>> That looks ok to see PGPROC as an "acceptable" one, if not, should we use the
>>> union trick?
>>
>> It seems acceptable to just not align it if the compiler doesn't support it.
>> This is just a performance optimization, after all.
>
> Agreed.
>
>> Attached is new versions the remaining patches. I think these are ready to
>> be committed.
>
> Thanks!
>
> One nit, 0001 is adding the typedef:
>
> "
> -struct PGPROC
> +typedef struct PGPROC
> .
> .
> .
> -};
> -
> -/* NOTE: "typedef struct PGPROC PGPROC" appears in storage/lock.h. */
> + uint32 wait_event_info; /* proc's wait information */
> +} PGPROC;
> "
>
> Would that make more sense to add the typedef when we introduce the explicit
> alignment in 0002 (like it was done in your previous
> v2-0001-Align-PGPROC-to-cache-line-boundary.patch up-thread)?

Yeah, I had it as part of the other commit in the previous version, but
decided to make it part of the other one, so that it's more clear what
the alignment. I don't think it matters much either way though.

Pushed, thanks for the review!

- Heikki

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2026-02-22 17:23:06 pgsql: Release notes for 18.3, 17.9, 16.13, 15.17, 14.22.
Previous Message Heikki Linnakangas 2026-02-22 11:14:59 pgsql: Align PGPROC to cache line boundary

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2026-02-22 11:20:57 Re: Skipping schema changes in publication
Previous Message Etsuro Fujita 2026-02-22 11:10:57 Re: Comment for UserMappingPasswordRequired in contrib/postgres_fdw