summaryrefslogtreecommitdiffstats
path: root/runtime/gc/accounting/space_bitmap.h
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-04-11 17:53:48 -0700
committerMathieu Chartier <mathieuc@google.com>2014-04-25 14:08:49 -0700
commit73d1e17b3afc7d5e56184f90bf819dc64956448a (patch)
tree6fee546dcebc0c8979a62be7e75c337f79b2ac2e /runtime/gc/accounting/space_bitmap.h
parente8256e7773a230337c3d137cbf0365f737820405 (diff)
downloadart-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/gc/accounting/space_bitmap.h')
-rw-r--r--runtime/gc/accounting/space_bitmap.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/runtime/gc/accounting/space_bitmap.h b/runtime/gc/accounting/space_bitmap.h
index df3fd37..5c7cce2 100644
--- a/runtime/gc/accounting/space_bitmap.h
+++ b/runtime/gc/accounting/space_bitmap.h
@@ -200,6 +200,9 @@ class SpaceBitmap {
SpaceBitmap(const std::string& name, MemMap* mem_map, uword* bitmap_begin, size_t bitmap_size,
const void* heap_begin);
+ // Helper function for computing bitmap size based on a 64 bit capacity.
+ static size_t ComputeBitmapSize(uint64_t capacity);
+
template<bool kSetBit>
bool Modify(const mirror::Object* obj);