Commit 29d861ec authored by Dominik Inführ's avatar Dominik Inführ Committed by Commit Bot

Revert "[heap] Avoid ParkedMutexGuard during allocation"

This reverts commit 273f4e42.

Reason for revert: Based on another need that needs to be reverted because of TSAN failures.

Original change's description:
> [heap] Avoid ParkedMutexGuard during allocation
> 
> Since main thread allocation does not start incremental marking anymore
> while holding allocation_mutex_, background allocation does not need
> ParkedMutexGuard anymore to avoid deadlocks.
> 
> This also means background thread allocation isn't paused anymore to
> perform a GC, which already resulted in subtle bugs (e.g. in
> ExpandBackground with incremental marking). We also do not
> stop-the-world anymore while holding allocation_mutex_.
> 
> Bug: v8:10315
> Change-Id: Iadf00bc26434c765722b82a10497ab06151f15cc
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2289771
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#68754}

TBR=ulan@chromium.org,dinfuehr@chromium.org

Change-Id: I3a16c13626c891e8063564fc05fd2d3fc427d159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:10315
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2289975Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68761}
parent 8ba517e1
......@@ -347,7 +347,7 @@ Page* PagedSpace::Expand() {
Page* PagedSpace::ExpandBackground(LocalHeap* local_heap) {
Page* page = AllocatePage();
if (page == nullptr) return nullptr;
base::MutexGuard lock(&allocation_mutex_);
ParkedMutexGuard lock(local_heap, &allocation_mutex_);
AddPage(page);
Free(page->area_start(), page->area_size(),
SpaceAccountingMode::kSpaceAccounted);
......@@ -580,7 +580,7 @@ PagedSpace::SlowGetLinearAllocationAreaBackground(LocalHeap* local_heap,
// First try to refill the free-list, concurrent sweeper threads
// may have freed some objects in the meantime.
{
base::MutexGuard lock(&allocation_mutex_);
ParkedMutexGuard lock(local_heap, &allocation_mutex_);
RefillFreeList();
}
......@@ -599,7 +599,7 @@ PagedSpace::SlowGetLinearAllocationAreaBackground(LocalHeap* local_heap,
invalidated_slots_in_free_space);
{
base::MutexGuard lock(&allocation_mutex_);
ParkedMutexGuard lock(local_heap, &allocation_mutex_);
RefillFreeList();
}
......@@ -631,7 +631,7 @@ PagedSpace::TryAllocationFromFreeListBackground(LocalHeap* local_heap,
size_t max_size_in_bytes,
AllocationAlignment alignment,
AllocationOrigin origin) {
base::MutexGuard lock(&allocation_mutex_);
ParkedMutexGuard lock(local_heap, &allocation_mutex_);
DCHECK_LE(min_size_in_bytes, max_size_in_bytes);
DCHECK_EQ(identity(), OLD_SPACE);
......
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