diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-04-11 17:53:48 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-04-25 14:08:49 -0700 |
commit | 73d1e17b3afc7d5e56184f90bf819dc64956448a (patch) | |
tree | 6fee546dcebc0c8979a62be7e75c337f79b2ac2e /runtime/thread.cc | |
parent | e8256e7773a230337c3d137cbf0365f737820405 (diff) | |
download | art-73d1e17b3afc7d5e56184f90bf819dc64956448a.zip art-73d1e17b3afc7d5e56184f90bf819dc64956448a.tar.gz art-73d1e17b3afc7d5e56184f90bf819dc64956448a.tar.bz2 |
Enable reading page map without lock in RosAlloc::BulkFree
Enabling this flag greatly reduces how much time was spent in the GC.
It was not done previously since it was regressing MemAllocTest. With
these RosAlloc changes, the benchmark score no longer regresses after
we enable the flag.
Changed Run::AllocSlot to only have one mode of allocation. The new
mode is finding the first free bit in the bitmap. This was
previously the slow path but is now the fast path. Some optimizations
which enabled this include always having the alloc bitmap bits which
correspond to invalid slots be set to 1. This prevents us from needing
a bound check since we will never end up allocating there.
Changed revoking thread local buffer to point to an invalid run. The
invalid run is just a run which always has all the allocation bits set
to 1. When a thread attempts to do a thread local allocation from here
it will always fail and go slow path. This eliminates the need for a
null check for revoked runs.
Changed zeroing of memory to happen during free, AllocPages should
always return zeroed memory. Added prefetching which happens when we
allocate a run.
Some refactoring to reduce duplicated code.
Ergonomics changes: Changed kStickyGcThroughputAdjustment to 1.0,
this helps reduce GC time.
Measurements (3 samples per benchmark):
Before: MemAllocTest scores: 3463, 3445, 3431
EvaluateAndApplyChanges score | total GC time
Iter 1: 3485, 23.602436s
Iter 2: 3434, 22.499882s
Iter 3: 3483, 23.253274s
After: MemAllocTest scores: 3495, 3417, 3409
EvaluateAndApplyChanges score | total GC time:
Iter 1: 3375, 17.463462s
Iter 2: 3358, 16.185188s
Iter 3: 3367, 15.822312s
Bug: 8788501
Bug: 11790317
Bug: 9986565
Change-Id: Ifd273a054824028dabed27c07c081dde1816f93c
Diffstat (limited to 'runtime/thread.cc')
-rw-r--r-- | runtime/thread.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/thread.cc b/runtime/thread.cc index 095404f..771680b 100644 --- a/runtime/thread.cc +++ b/runtime/thread.cc @@ -1018,7 +1018,8 @@ Thread::Thread(bool daemon) : tls32_(daemon), wait_monitor_(nullptr), interrupte tls32_.state_and_flags.as_struct.flags = 0; tls32_.state_and_flags.as_struct.state = kNative; memset(&tlsPtr_.held_mutexes[0], 0, sizeof(tlsPtr_.held_mutexes)); - memset(tlsPtr_.rosalloc_runs, 0, sizeof(tlsPtr_.rosalloc_runs)); + std::fill(tlsPtr_.rosalloc_runs, tlsPtr_.rosalloc_runs + kRosAllocNumOfSizeBrackets, + gc::allocator::RosAlloc::GetDedicatedFullRun()); for (uint32_t i = 0; i < kMaxCheckpoints; ++i) { tlsPtr_.checkpoint_functions[i] = nullptr; } |