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

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
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-11 10:58:41
Message-ID: aYxg4VkaviXZSdqS@ip-10-97-1-34.eu-west-3.compute.internal
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Hi,

On Wed, Feb 11, 2026 at 12:03:51PM +0200, Heikki Linnakangas wrote:
> On 11/02/2026 06:40, Bertrand Drouvot wrote:
> > > With this, sizeof(PGPROC) == 864 without the explicit alignment to
> > > PG_CACHE_LINE_SIZE, and 896 with it.
> >
> > I can see 876 -> 896 on my side:
> >
> > /* 872 | 4 */ uint32 wait_event_info;
> > /* XXX 20-byte padding */
> >
> > /* total size (bytes): 896 */
> > }
>
> Interesting. I've attached 'pahole bin/postgres' output from my laptop. It's
> Linux on arm64.

Thanks!

Got it: I was using "-DCACHEDEBUG -DWAL_DEBUG -DLOCK_DEBUG -DDEBUG_DEADLOCK"
so that with LOCK_DEBUG in place then LWLock size is 32 bytes (vs 16 in your case).

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2026-02-11 15:01:58 pgsql: Move ProcStructLock to the ProcGlobal struct
Previous Message Dean Rasheed 2026-02-11 10:56:38 pgsql: doc: Mention all SELECT privileges required by INSERT ... ON CON

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-02-11 11:06:32 Re: Fix wrong log in pgstat_report_checksum_failures_in_db()
Previous Message Jakub Wartak 2026-02-11 10:43:23 Re: pg_stat_io_histogram