Keep pac last in pa_shard_s to fix SEC-in-PAC layout regression

9c1a484e embedded sec_t in pac_t (+~48B). Since pac sits before the hot
hpa/edata_cache fields in pa_shard_s, the larger pac_t shifts them and
regresses the free/extent paths ~2% on the fill-flush microbenchmark --
even though SEC is disabled by default and no SEC code runs; it is purely
a struct-layout effect.

Move pac to the last field so its growth shifts only the trailing
all_bins[] flex array. Pure reorder, no functional change.

Validated with the fill-flush microbenchmark (500 threads, 256 B,
MALLOC_CONF=tcache:true,prof:true), turbo pinned, interleaved medians:
on AMD EPYC 9D64 (x86-64) bad regresses ~2% and the reorder restores the
baseline; on ARM Neoverse-V2 (aarch64) there is no measurable regression
and the reorder is neutral.
This commit is contained in:
Slobodan Predolac 2026-06-26 15:15:36 -07:00 committed by Guangli Dai
parent 9c1a484e1d
commit db15a39d75

View file

@ -91,9 +91,6 @@ struct pa_shard_s {
*/
bool ever_used_hpa;
/* Allocates from a PAC. */
pac_t pac;
hpa_shard_t hpa;
/* The source of edata_t objects. */
@ -109,6 +106,9 @@ struct pa_shard_s {
/* The base from which we get the ehooks and allocate metadat. */
base_t *base;
/* Allocates from a PAC. */
pac_t pac;
};
static inline bool