mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-22 04:03:11 +00:00
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:
committed by
Guangli Dai
parent
9c1a484e1d
commit
db15a39d75
@@ -91,9 +91,6 @@ struct pa_shard_s {
|
|||||||
*/
|
*/
|
||||||
bool ever_used_hpa;
|
bool ever_used_hpa;
|
||||||
|
|
||||||
/* Allocates from a PAC. */
|
|
||||||
pac_t pac;
|
|
||||||
|
|
||||||
hpa_shard_t hpa;
|
hpa_shard_t hpa;
|
||||||
|
|
||||||
/* The source of edata_t objects. */
|
/* 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. */
|
/* The base from which we get the ehooks and allocate metadat. */
|
||||||
base_t *base;
|
base_t *base;
|
||||||
|
|
||||||
|
/* Allocates from a PAC. */
|
||||||
|
pac_t pac;
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline bool
|
static inline bool
|
||||||
|
|||||||
Reference in New Issue
Block a user