RFR: Use PLABs for old gen allocations, including promotions. [v4]

Bernd Mathiske bmathiske at openjdk.java.net
Thu Apr 29 19:13:56 UTC 2021


> Introducing a 3rd kind of LAB for generational mode: "PLAB".
> 
> Shenandoah already has TLABs and GCLABs. The latter pertain firmly to young gen and allocations in old gen are so far always shared allocations, without LAB. With this PR, old gen allocations go through LABs as well and we separate those from the other two kinds. In other words, each generation has its separate GC-decicated LAB. 
> 
> When not in generational mode, GCLABs work as before and PLABs are never used.
> 
> The new diagnostic flag -XX:-ShenandoahUsePLAB can be used to turn off PLAB use, so that all old gen allocations are shared as before this PR. By default PLABs will be used.
> 
> Note that In source code, the type of both GCLABs and PLABs is "PLAB*", sonce GCLABs already had that type, but variable references and other value-level identifiers are consistently named "gclab" and "plab".
> 
> In ShenandoahFreeSet::allocate_single() there is a notable additional change that can easily be reverted if needed. Instead of fitting the intended allocation into any free or occupied region that can hold it, we now search for an occupied region in the same generation first, before considering free regions. The idea is to pack regions more densely as long as they have space left. This provides more opportunity for region borrowing between generations, should the need arise. For single-generational Shenandoah, it should not make a huge difference, right? Or is it crucial to find any free slot hit in that search loop ASAP?
> 
> Full collections need to set empty/trash regions that they compact into to non-FREE. For now, they will be made "YOUNG". (See the second commit.)

Bernd Mathiske has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains ten commits:

 - Merge branch 'master' into plab
 - Remove redundant trash recycling in flip_to_gc().
 - Only register old filler objects when evacuation copy fails
 - Register 'filler' objects with remembered set when plabs are retired
 - Register object starts when allocating from PLAB
 - Register filler objects for unsuccessful non-LAB evacuations.
 - Track proper affiliation when allocating.
 - Update region affiliation in full GC's "regular bypass".
 - Use PLABs for object promotions to old gen and for old gen evacuations.

-------------

Changes: https://git.openjdk.java.net/shenandoah/pull/30/files
 Webrev: https://webrevs.openjdk.java.net/?repo=shenandoah&pr=30&range=03
  Stats: 341 lines in 17 files changed: 246 ins; 45 del; 50 mod
  Patch: https://git.openjdk.java.net/shenandoah/pull/30.diff
  Fetch: git fetch https://git.openjdk.java.net/shenandoah pull/30/head:pull/30

PR: https://git.openjdk.java.net/shenandoah/pull/30


More information about the shenandoah-dev mailing list