Try to use different chunks for nursery and tenured owned buffer allocator allocations
Categories
(Core :: JavaScript: GC, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox157 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
(Blocks 1 open bug)
Details
Attachments
(6 external files)
Currently the buffer allocator allocates into the smallest free region that will satisfy the allocation size regardless of whether the allocation is owned by a nursery or tenured GC thing. When it comes to minor GC we must sweep all chunks with nursery owned allocations in them.
By partitioning free regions by whether their chunk contains nursery owned buffers or not and trying to allocate nursery owned allocations into chunks that already have nursery owned allocations we can reduce the number of chunks we need to sweep on minor GC.
| Assignee | ||
Comment 1•3 months ago
|
||
This is just plumbing. The parameter will be used by future patches.
| Assignee | ||
Comment 2•3 months ago
|
||
Small refactoring to make assertions less verbose.
| Assignee | ||
Comment 3•3 months ago
|
||
This is used for a heuristic in the next patch.
| Assignee | ||
Comment 4•3 months ago
|
||
The adds separate free lists for mixed / tenured chunks and uses them based on
whether the allocation is nursery or tenured owned.
We don't want to do this all the time. For small heaps we want to share chunks
between nursery and tenured owned allocations. And to prevent reducing the heap
density too much we probably don't want to allocate branch new chunks for both
tenured and nursery owned allocations (although I'm less sure on this). Mainly
we want to do this when allocating into previously swept partially used chunks.
This is implemented by the flag |allocTenuredInMixedChunks|. This is set to
true for small heaps (currently <= 4 MB) and when we run out of available
chunks and start allocating new ones.
This simplifies BufferAllocator::startMinorSweeping and removes scanning the
free lists. This also lets us skip moving tenured free lists to their chunk
header on minor GC which was there so that scanning free lists didn't take too
long.
| Assignee | ||
Comment 5•2 months ago
|
||
This doesn't change any behaviour it just reorganises the following:
- Make BufferAllocator::makeFreeRegion into FreeRegion::create
- Make BufferAllocator::pushFreeRegionFront/Back into FreeLists::pushFront/back
- Remove unnecessary BufferAllocator* parameter to sweep metonds
- Move BufferAllocator::addSweptRegion methods to BufferChunk and SmallBufferRegion
| Assignee | ||
Comment 6•2 months ago
|
||
Rather than moving free regions in tenured chunks back to the chunk header on
major GC, just clear them and rebuild if necessary. The only time we need them
is if we abort collection as they are rebuilt when we sweep.
Comment 9•2 months ago
|
||
Backed out for causing failures at BufferAllocator.cpp
Backout link: https://hg.mozilla.org/integration/autoland/rev/5fb337ec063a
Push where failures started: https://treeherder.mozilla.org/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception%2Cretry%2Cusercancel&revision=eb7f2c586d5a3e30fe9be5737ab8e6851246908b&selectedTaskRun=cUAB8Q77R_-4q2t3PDHtJg.0
Failure log: https://treeherder.mozilla.org/logviewer?job_id=588719164&repo=autoland&task=cUAB8Q77R_-4q2t3PDHtJg.0&lineNumber=1874
| Assignee | ||
Updated•2 months ago
|
Comment 10•2 months ago
|
||
Comment 11•2 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/c969bc9b6af5
https://hg.mozilla.org/mozilla-central/rev/f7b90a271097
https://hg.mozilla.org/mozilla-central/rev/c50bab3ac679
https://hg.mozilla.org/mozilla-central/rev/faf6c319a8f6
https://hg.mozilla.org/mozilla-central/rev/1cbdbb427e18
https://hg.mozilla.org/mozilla-central/rev/6176c6090ea5
Description
•