Commit 84435faf authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[heap] Skip never-evacuate pages from sweeper limit accouting

If concurrent sweeping is not making progress, then the slow path of allocation
tries to sweep one page before allocating a new page. If that one page happens
to be a never-evacuate page, then sweeping it will not produce any free space.

This is problematic for tests that disable page allocation by setting the
force_oom flag. Such tests become sensitive to the number of pages marked
as never-evacuate (i.e. pages that were deserialized from the snapshot).

Bug: v8:9205
Change-Id: If19a036b67319a5a2170f378f2c07ffa01bb7b27
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1601259Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61344}
parent 7b161848
......@@ -413,7 +413,11 @@ int Sweeper::ParallelSweepSpace(AllocationSpace identity,
Page* page = nullptr;
while ((page = GetSweepingPageSafe(identity)) != nullptr) {
int freed = ParallelSweepPage(page, identity);
pages_freed += 1;
if (!page->NeverEvacuate()) {
// Pages are marked as never-evacuate after deserialization. They have
// no free space. Do not account them towards the |max_pages| limit.
pages_freed += 1;
}
DCHECK_GE(freed, 0);
max_freed = Max(max_freed, freed);
if ((required_freed_bytes) > 0 && (max_freed >= required_freed_bytes))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment