Use all available workers for concurrent marking.

R=ulan@chromium.org

Bug: chromium:812178
Change-Id: I35a727cb6c663bbd5f1beab98324e5d1b1ecf5c7
Reviewed-on: https://chromium-review.googlesource.com/918663
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51458}
This commit is contained in:
Gabriel Charette 2018-02-16 12:51:42 +01:00 committed by Commit Bot
parent 28c81eeef7
commit 3c62f7ae07
2 changed files with 5 additions and 9 deletions

View File

@ -506,14 +506,10 @@ void ConcurrentMarking::ScheduleTasks() {
base::LockGuard<base::Mutex> guard(&pending_lock_);
DCHECK_EQ(0, pending_task_count_);
if (task_count_ == 0) {
// TODO(ulan): Increase the number of tasks for platforms that benefit
// from it.
task_count_ =
(static_cast<int>(
V8::GetCurrentPlatform()->NumberOfAvailableBackgroundThreads()) +
1) /
2;
task_count_ = Max(Min(task_count_, kMaxTasks), 1);
task_count_ = Max(
1, Min(kMaxTasks,
static_cast<int>(V8::GetCurrentPlatform()
->NumberOfAvailableBackgroundThreads())));
}
// Task id 0 is for the main thread.
for (int i = 1; i <= task_count_; i++) {

View File

@ -53,7 +53,7 @@ class ConcurrentMarking {
COMPLETE_TASKS_FOR_TESTING,
};
static constexpr int kMaxTasks = 4;
static constexpr int kMaxTasks = 8;
using MarkingWorklist = Worklist<HeapObject*, 64 /* segment size */>;
ConcurrentMarking(Heap* heap, MarkingWorklist* shared,