RFR (S): 8049341: Parallelize clearing the next mark bitmap

Thomas Schatzl thomas.schatzl at oracle.com
Mon Sep 1 08:53:42 UTC 2014


Hi Marcus,

On Mon, 2014-09-01 at 09:43 +0200, Marcus Larsson wrote:
> Hi again,
> 
> Updated the changeset to a more recent version, with changes suggested 
> by Mikael.
> 
> Webrev:
> http://cr.openjdk.java.net/~mgerdin/mlarsson/webrev-8049341v2/

  I would prefer if the parallel iteration over the heap regions used
the available G1CollectedHeap::heap_region_par_iterate_chunked()
mechanism. Using it avoids imbalance of work due to not all regions
being available.

For this, the per-region claim value (HeapRegion::_claim) should
probably be extracted from the HeapRegion (where it imo does not belong
in the first place) because the concurrent bitmap clear may be
interrupted by young GCs that use it too. Please add a separate
refactoring CR for that.

Then the pattern established by other parallel gc tasks that use
heap_region_par_iterate_chunked() can be reused.

With the recent changes I asked this change to be updated with, this
task unfortunately also got a lot harder - it includes JDK-8038423 that
allows arbitrary regions to be not committed - including the
corresponding bitmaps.

The change does not take that into account, so the VM fails in any test
stressing commit/uncommit of bitmaps.
E.g. fails at the assert at heapRegionmanager.cpp:220 when it tries to
iterate over known not-available regions.

Another requirement that is not met is that the current parallel code
must cancel all further clearing of all threads as soon any thread
yields and there is an abort of the concurrent mark task.

Otherwise threads that do not stop after such a yield may clear valid
bits added by some following initial mark.

E.g. consider this sequence of GC events:

conc-mark-start
full gc (clears bitmap already)
conc-clear-start (yields)
initial-mark (does initial marking)
conc-clear-continue (resumes and overwrites valid marks)

> On 08/28/2014 01:06 PM, Marcus Larsson wrote:
> > Hi,
> >
> > I would like reviews for the following patch to parallelize the 
> > clearing of the next mark bitmap in G1.
> >
> > Short summary:
> > The heap is divided into as many parts as there are workers and each 
> > worker will clear its corresponding part of the bitmap. Workers will 
> > join the suspendible thread set instead of the concurrent mark thread 
> > to properly allow them to yield during clearing work. Added support 
> > for applying heap region closures to a specific part of the heap. 
> > SPECjbb2013 shows a slight performance gain with this change (4%, 
> > using 4 concurrent threads).
> >
> > Webrev:
> > http://cr.openjdk.java.net/~brutisso/webrev-8049341/
> >
> > Bug:
> > https://bugs.openjdk.java.net/browse/JDK-8049341
> >
> > Testing:
> > jprt, SPECjbb2013, SPECjbb2005, SPECjvm2008
> >

Unfortunately, these tests do not stress region commit/uncommit in
combination with full gcs interrupting concurrent marking.

Please use the vm.gc.compact.* tests from UTE. They are also included in
the vm.gc.* testlists.

Thanks,
  Thomas






More information about the hotspot-gc-dev mailing list