OSDN Git Service

Improve CC handling for immune objects
authorMathieu Chartier <mathieuc@google.com>
Fri, 22 Jul 2016 17:47:45 +0000 (10:47 -0700)
committerMathieu Chartier <mathieuc@google.com>
Mon, 25 Jul 2016 22:35:52 +0000 (15:35 -0700)
commit21328a15e15005815efc843e774ac6974e94d4d8
tree8072453c0d072ce5be26271e0e97786d4a52626e
parent84413a7617602c466e39de8e8897914a6d06779d
Improve CC handling for immune objects

Currently we reduce ram for immune objects by racing agianst the
mutators to try and finish processing them before the mutators
change many objects to gray. However there is still a window of time
where the mutator can dirty immune pages by changing the lock words
to gray. These pages remain dirty for the lifetime of the app.

This CL changes uses the FlipCallback pause to gray all of the
immune objects that have a dirty card. Once these objects are all
gray we don't to gray any more objects in the immune spaces since
these objects are the only ones that may reference non immune
objects.

Also only scan objects that are gray when scanning immune spaces to
reduce scanning time.

System wide PSS after boot on N9, before:
61668 kB: .art mmap
11249 kB: .Zygote

After:
36013 kB: .art mmap
12251 kB: .Zygote

Results are better than demonstrated since there are more apps
running after.

Maps PSS / Private Dirty, before:
.art mmap     3703     3116
  .Zygote      577      480

After:
.art mmap     1655     1092
  .Zygote      476      392

System server before:
.art mmap     4453     3956
  .Zygote      849      780

After:
.art mmap     2326     1748
  .Zygote      640      564

EAAC:
Before:
ScanImmuneSpaces takes 669.434ms GC time
Scores: 718, 761, 753 average 744
GC time: 4.2s, 4.35s, 4.3s average 4.28s

After:
ScanImmuneSpaces takes 138.328ms GC time
Scores: 731, 730, 704 average 722
GC time: 3.92s, 3.83s, 3.85s average 3.87s

Additional GC pause time is 285us on Maps on N9.
TODO: Reduce this pause time.

Test: N9 booting, test-art-host, EAAC all run with CC

Bug: 29516968
Bug: 12687968

Change-Id: I584b10d017547b321f33eb23fb5d64372af6f69c
runtime/gc/accounting/mod_union_table.cc
runtime/gc/accounting/mod_union_table.h
runtime/gc/collector/concurrent_copying.cc
runtime/gc/collector/concurrent_copying.h