Closed Bug 2066149 Opened 3 months ago Closed 2 months ago

Try to use different chunks for nursery and tenured owned buffer allocator allocations

Categories

(Core :: JavaScript: GC, task, P3)

task

Tracking

()

RESOLVED FIXED
157 Branch
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.

This is just plumbing. The parameter will be used by future patches.

This is used for a heuristic in the next patch.

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.

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

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.

Pushed by abutkovits@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ac9bc96e0569 https://hg.mozilla.org/integration/autoland/rev/5fb337ec063a Revert "Bug 2066149 - Part 6: Rebuild free lists for swept chunks on demand r=sfink" for causing failures at BufferAllocator.cpp
Flags: needinfo?(jcoppeard)
Regressions: 2068149
Regressions: 2068849
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: