RFR: 8327387: G1: Refactor region liveness processing after completion of concurrent marking

Guoxiong Li gli at openjdk.org
Wed Mar 6 14:12:46 UTC 2024


On Tue, 5 Mar 2024 17:23:11 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> The diff is not quite easy to follow. Instead, I'd recommend to read the new code directly, and the entry-point (and the gist) is in `G1OnRegionClosure::do_heap_region`.
> 
> While running BigRamTester, h2, and specjbb2015-fixed, a slight reduction in subphase time (approximately 0.01ms) was observed. However, it's important to note that these subphases are already quite brief in baseline.
> 
> Test: tier1-6

Nice refactor!

src/hotspot/share/gc/g1/g1ConcurrentMark.cpp line 1226:

> 1224:         _g1h->free_humongous_region(hr, _local_cleanup_list);
> 1225:         hr->clear_cardtable();
> 1226:         _g1h->concurrent_mark()->clear_statistics(hr);

The method `free_humongous_region` may be good to have the same location with the method `free_region` below. Both could be put at the end or before `clear_cardtable`. Just a nit.

src/hotspot/share/gc/g1/g1ConcurrentMark.cpp line 1242:

> 1240:       hr->clear_cardtable();
> 1241:       _g1h->concurrent_mark()->clear_statistics(hr);
> 1242:       _g1h->free_region(hr, _local_cleanup_list);

Here.

src/hotspot/share/gc/g1/g1ConcurrentMark.cpp line 1317:

> 1315:       MutexLocker x(G1RareEvent_lock, Mutex::_no_safepoint_check_flag);
> 1316:       _g1h->decrement_summary_bytes(on_region_cl._freed_bytes);
> 1317: 

In order to update some statistics, we need a atomic operation and acquire two locks here (one is in `remove_from_old_gen_sets`). It may need to be optimized in the future.

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

Marked as reviewed by gli (Committer).

PR Review: https://git.openjdk.org/jdk/pull/18127#pullrequestreview-1919837920
PR Review Comment: https://git.openjdk.org/jdk/pull/18127#discussion_r1514543274
PR Review Comment: https://git.openjdk.org/jdk/pull/18127#discussion_r1514546551
PR Review Comment: https://git.openjdk.org/jdk/pull/18127#discussion_r1514533866


More information about the hotspot-gc-dev mailing list