-
Story
-
Resolution: Done
-
Undefined
-
None
-
rhel-8.10.z, rhel-9.0.0, rhel-10.1
-
None
-
3
-
rhel-pt-c-libs
-
ssg_platform_tools
-
5
-
False
-
False
-
-
No
-
Red Hat Enterprise Linux
-
PT Libraries 2025 S07, PT Libraries 2025 S08, PT Libraries 2025 S09
-
None
-
None
-
Unspecified Release Note Type - Unknown
-
Unspecified
-
Unspecified
-
Unspecified
-
-
All
-
All
-
None
We need an experimental allocator that does not put freed chunks into tcache if the chunk is from an arena that is not attached to the current thread.
Avoiding cross-arena tcache usage may help to reduce the unwanted side effects that occur when customer workloads move from RHEL 7 to RHEL 8. There is not enough data at this point to confirm that allocations that are in other threads' tcaches block arena/heap consolidation for relevant workloads, but it seems a good guess.
Technical details/implementation sketch
- Development should happen against the upstream master branch, but we'll eventually need to create an 8.10.z test build.
- Obtaining the arena pointer from a chunk pointer is currently rather costly because it's necessary to load it from the start of the heap region. Currently, for chunks that go into tcache during free, the arena pointer does not need to be determined, and the arena pointer determination is not on the tcache fast path.
- Non-main-arena, non-mmapped allocations are at most 64 MB, so the upper 32 bits in the chunk header are unused.
- Use those unused bits to store an arena number. Store the same arena number as a TLS variable (in addition to tcache and thread_arena).
- During free, check if the arena ID in the chunk header matches the thread's arena ID. If not, perform a full free (potentially going into fastbin).
- This may increase the risk of runaway fastbin chains. These could be fixed in separate change (but the same risk already exists in RHEL 7).