Re: PGPROC alignment (was Re: pgsql: Separate RecoveryConflictReasons from procsignals)
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>,
Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Andres Freund <andres@anarazel.de>,
"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2026-02-23T16:13:29Z
Lists: pgsql-hackers
On 13.02.26 09:03, Bertrand Drouvot wrote: > +/* > + * If compiler understands aligned pragma, use it to align the struct at cache > + * line boundaries. This is just for performance, to (a) avoid false sharing > + * and (b) to make the multiplication / division to convert between PGPROC * > + * and ProcNumber be a little cheaper. > + */ > +#if defined(pg_attribute_aligned) > + pg_attribute_aligned(PG_CACHE_LINE_SIZE) > +#endif > +PGPROC; You can/should use C11 standard alignas(), so you don't need to worry about whether it's supported or not.
Commits
-
Use C11 alignas in typedef definitions
- 5c2a8d272b9a 19 (unreleased) landed
-
Align PGPROC to cache line boundary
- 412f78c66eed 19 (unreleased) landed
-
Rearrange fields in PGPROC, for clarity
- 2e0853176f8f 19 (unreleased) landed
-
Split PGPROC 'links' field into two, for clarity
- 36bbcd5be3ff 19 (unreleased) landed
-
Remove useless store to local variable
- ab32a9e21d37 19 (unreleased) landed
-
Separate RecoveryConflictReasons from procsignals
- 17f51ea81875 19 (unreleased) cited