Commit 3082e450 authored by haraken@chromium.org's avatar haraken@chromium.org

Oilpan: Scale up the number of marking threads according to available processors

Currently we use 2 marking threads regardless of the number of processors available.
Given that the marking phase takes a substantial amount of time,
this CL changes the number of marking threads to min(the number of processors, 4).

This CL also decreases the block size of each CallStack from 200 to 128
because load balancing is not good in some benchmarks such as LargeDistributionWithoutLayout. This CL improves LargeDistributionWithoutLayout by 10% for example.

BUG=420515

Review URL: https://codereview.chromium.org/648633002

git-svn-id: svn://svn.chromium.org/blink/trunk@183613 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 8c79bd8c
......@@ -53,7 +53,7 @@ public:
bool hasCallbackForObject(const void*);
#endif
static const size_t blockSize = 200;
static const size_t blockSize = 128;
private:
class Block;
......
......@@ -2141,11 +2141,10 @@ void Heap::init()
s_orphanedPagePool = new OrphanedPagePool();
s_markingThreads = new Vector<OwnPtr<blink::WebThread> >();
if (blink::Platform::current()) {
// FIXME: We should let the amount of threads scale with the
// amount of processors in the system instead of hardcoding
// it.
int processors = blink::Platform::current()->numberOfProcessors();
int numberOfMarkingThreads = std::min(processors, maxNumberOfMarkingThreads);
for (int i = 0; i < numberOfMarkingThreads; i++)
s_markingThreads->append(adoptPtr(blink::Platform::current()->createThread("Blink Heap Marker Thread")));
s_markingThreads->append(adoptPtr(blink::Platform::current()->createThread("Blink GC Marking Thread")));
}
}
......
......@@ -94,7 +94,7 @@ const uint8_t finalizedZapValue = 24;
// the mark bit when tracing.
const uint8_t orphanedZapValue = 240;
const int numberOfMarkingThreads = 2;
const int maxNumberOfMarkingThreads = 4;
const int numberOfPagesToConsiderForCoalescing = 100;
......@@ -904,7 +904,7 @@ public:
static void collectGarbage(ThreadState::StackState, ThreadState::CauseOfGC = ThreadState::NormalGC);
static void collectGarbageForTerminatingThread(ThreadState*);
static void collectAllGarbage();
static void processMarkingStackEntries(int* numberOfMarkingThreads);
static void processMarkingStackEntries(int*);
static void processMarkingStackOnMultipleThreads();
static void processMarkingStackInParallel();
template<CallbackInvocationMode Mode> static void processMarkingStack();
......
......@@ -330,7 +330,7 @@ ThreadState::ThreadState()
m_weakCallbackStack = new CallbackStack();
if (blink::Platform::current())
m_sweeperThread = adoptPtr(blink::Platform::current()->createThread("Blink GC Sweeper"));
m_sweeperThread = adoptPtr(blink::Platform::current()->createThread("Blink GC Sweeper Thread"));
}
ThreadState::~ThreadState()
......
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