pgsql: Align PGPROC to cache line boundary

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Align PGPROC to cache line boundary
Date: 2026-02-22 11:14:59
Message-ID: E1vu7QR-000bae-03@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Align PGPROC to cache line boundary

On common architectures, the PGPROC struct happened to be a multiple
of 64 bytes on PG 18, but it's changed on 'master' since. There was
worry that changing the alignment might hurt performance, due to false
cacheline sharing across elements in the proc array. However, there
was no explicit alignment, so any alignment to cache lines was
accidental. Add explicit alignment to remove worry about false
sharing.

Reviewed-by: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/3dd6f70c-b94d-4428-8e75-74a7136396be@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/412f78c66eedbe9cf41a657f4566d86a69ab7af2

Modified Files
--------------
src/include/storage/proc.h | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2026-02-22 11:15:03 Re: PGPROC alignment (was Re: pgsql: Separate RecoveryConflictReasons from procsignals)
Previous Message Heikki Linnakangas 2026-02-22 11:14:58 pgsql: Rearrange fields in PGPROC, for clarity