Update a0's oversize threshold regardless whether huge arena is enabled or not.

This commit is contained in:
guangli-dai 2026-04-28 22:10:27 -07:00 committed by lexprfuncall
parent 70b228dece
commit ee4d7b7f9a

View file

@ -1954,9 +1954,6 @@ arena_init_huge(tsdn_t *tsdn, arena_t *a0) {
huge_arena_ind = narenas_total_get();
assert(huge_arena_ind != 0);
oversize_threshold = opt_oversize_threshold;
/* a0 init happened before malloc_conf_init. */
atomic_store_zu(&a0->pa_shard.pac.oversize_threshold,
oversize_threshold, ATOMIC_RELAXED);
/* Initialize huge_arena_pac_thp fields. */
base_t *b0 = a0->base;
/* Make sure that b0 thp auto-switch won't happen concurrently here. */
@ -1974,6 +1971,10 @@ arena_init_huge(tsdn_t *tsdn, arena_t *a0) {
huge_enabled = true;
}
/* a0 init happened before malloc_conf_init. */
atomic_store_zu(&a0->pa_shard.pac.oversize_threshold,
oversize_threshold, ATOMIC_RELAXED);
return huge_enabled;
}