RFR: 8242847: G1 should not clear mark bitmaps with no marks

Thomas Schatzl tschatzl at openjdk.java.net
Mon Aug 23 12:51:32 UTC 2021


On Mon, 23 Aug 2021 12:41:47 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> Hi all,
>> 
>> Please review this change to bound the range of bitmap clearing for each region using the liveness data collected during marking. For the Concurrent Undo Mark cycle, the liveness information (next_top_at_mark_start and live_words) is in sync wrt. the _next_mark_bitmap that needs clearing. Hence, we use these details to clear only bitmaps for regions that were dirtied and need clearing i.e. only clear between [bottom, ntams), and only clear bitmaps for regions that had at least one bit set (i.e. have some live data).
>> 
>> Testing: Tier 1-3.
>
> src/hotspot/share/gc/g1/g1ConcurrentMark.cpp line 614:
> 
>> 612:       return r->next_top_at_mark_start();
>> 613:     }
>> 614:     return r->end();
> 
> If not in the `UndoMark` operation (and doing the work concurrently), we could use the `prev_top_at_mark_start()` here, couldn't we?

Out of curiosity, did you measure what gain (in saved bitmap distance) does using the TAMSes give here? Asking because most TAMSes should be either at the end (=almost the same as top) or bottom of the region, only the current old gen allocation region at the time of the concurrent mark start pause may have a different one (I think).

Maybe that additional suggested (by me) optimization is not worth the effort...

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

PR: https://git.openjdk.java.net/jdk/pull/5213



More information about the hotspot-gc-dev mailing list