Skip to content

Force Arena growth in UsageHint kMetadata test. - #940

Draft
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_982541454
Draft

copybara-service[bot] wants to merge 1 commit into
masterfrom
test_982541454

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Sep 16, 2026

Copy link
Copy Markdown

Force Arena growth in UsageHint kMetadata test.

Root Cause: VerifyUsageHintkMetadataTest installed a fresh region factory,
allocated 2 GiB with operator new, and asserted that the last region created
carried UsageHint::kMetadata. That relied on the pagemap growth for the new
range (64 leaves, 2.6 MB) forcing the Arena back to the system allocator. The
Arena can already hold that much: an aligned per-CPU slab allocation goes
through SystemAllocator::Allocate with the slab alignment and the returned
actual_size includes the alignment slop, which becomes free_avail_.

Exercise the intended path directly: after SetRegionFactory, request
bytes_unallocated + 1 from the Arena, which cannot be satisfied by the current
free area or any freelist block and therefore must obtain a new region with
UsageHint::kMetadata. Drop the 2 GiB user allocation, the leak suppression and
the now unused leak_check dependency.

Before: 8/3000 and 12/3000 failures. After: 3000/3000 pass.

@copybara-service
copybara-service Bot force-pushed the test_982541454 branch 12 times, most recently from 91a19ce to 73bf9ce Compare September 17, 2026 02:37
Root Cause: VerifyUsageHintkMetadataTest installed a fresh region factory,
allocated 2 GiB with operator new, and asserted that the last region created
carried UsageHint::kMetadata. That relied on the pagemap growth for the new
range (64 leaves, 2.6 MB) forcing the Arena back to the system allocator. The
Arena can already hold that much: an aligned per-CPU slab allocation goes
through SystemAllocator::Allocate with the slab alignment and the returned
actual_size includes the alignment slop, which becomes free_avail_.

Exercise the intended path directly: after SetRegionFactory, request
bytes_unallocated + 1 from the Arena, which cannot be satisfied by the current
free area or any freelist block and therefore must obtain a new region with
UsageHint::kMetadata. Drop the 2 GiB user allocation, the leak suppression and
the now unused leak_check dependency.

Before: 8/3000 and 12/3000 failures. After: 3000/3000 pass.
PiperOrigin-RevId: 982541454
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant