diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-03-10 09:28:23 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-03-10 09:28:23 -0700 |
commit | d6534315596326f1a65aa2d300144c09205c5122 (patch) | |
tree | ca81b65c38bb3e15120a108bbb92c19a8a0b1ed9 /runtime/gc | |
parent | d57abe5f75e2c82052d7396d6ec6eafc7f3af58a (diff) | |
download | art-d6534315596326f1a65aa2d300144c09205c5122.zip art-d6534315596326f1a65aa2d300144c09205c5122.tar.gz art-d6534315596326f1a65aa2d300144c09205c5122.tar.bz2 |
Add timing split for RevokeAllThreadLocalBuffers.
This is part of the pause and should be accounted for.
Change-Id: I3165324de810e8fab02719098977402a18013da1
Diffstat (limited to 'runtime/gc')
-rw-r--r-- | runtime/gc/collector/garbage_collector.cc | 12 | ||||
-rw-r--r-- | runtime/gc/collector/garbage_collector.h | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/runtime/gc/collector/garbage_collector.cc b/runtime/gc/collector/garbage_collector.cc index 094e274..1e1e447 100644 --- a/runtime/gc/collector/garbage_collector.cc +++ b/runtime/gc/collector/garbage_collector.cc @@ -64,6 +64,12 @@ void GarbageCollector::ResetCumulativeStatistics() { total_freed_bytes_ = 0; } +void GarbageCollector::RevokeAllThreadLocalBuffers() { + timings_.StartSplit("(Paused)RevokeAllThreadLocalBuffers"); + GetHeap()->RevokeAllThreadLocalBuffers(); + timings_.EndSplit(); +} + void GarbageCollector::Run(GcCause gc_cause, bool clear_soft_references) { ThreadList* thread_list = Runtime::Current()->GetThreadList(); Thread* self = Thread::Current(); @@ -89,14 +95,14 @@ void GarbageCollector::Run(GcCause gc_cause, bool clear_soft_references) { // current collector / allocator during process state updates. if (Locks::mutator_lock_->IsExclusiveHeld(self)) { // PreGcRosAllocVerification() is called in Heap::TransitionCollector(). - GetHeap()->RevokeAllThreadLocalBuffers(); + RevokeAllThreadLocalBuffers(); MarkingPhase(); ReclaimPhase(); // PostGcRosAllocVerification() is called in Heap::TransitionCollector(). } else { thread_list->SuspendAll(); GetHeap()->PreGcRosAllocVerification(&timings_); - GetHeap()->RevokeAllThreadLocalBuffers(); + RevokeAllThreadLocalBuffers(); MarkingPhase(); ReclaimPhase(); GetHeap()->PostGcRosAllocVerification(&timings_); @@ -121,7 +127,7 @@ void GarbageCollector::Run(GcCause gc_cause, bool clear_soft_references) { GetHeap()->PreGcRosAllocVerification(&timings_); done = HandleDirtyObjectsPhase(); if (done) { - GetHeap()->RevokeAllThreadLocalBuffers(); + RevokeAllThreadLocalBuffers(); } GetHeap()->PostGcRosAllocVerification(&timings_); ATRACE_END(); diff --git a/runtime/gc/collector/garbage_collector.h b/runtime/gc/collector/garbage_collector.h index 8d401b8..8259cf0 100644 --- a/runtime/gc/collector/garbage_collector.h +++ b/runtime/gc/collector/garbage_collector.h @@ -127,6 +127,8 @@ class GarbageCollector { // Called after the GC is finished. Done without mutators paused. virtual void FinishPhase() = 0; + void RevokeAllThreadLocalBuffers(); + static constexpr size_t kPauseBucketSize = 500; static constexpr size_t kPauseBucketCount = 32; |