RFR: 8327452: G1: Improve scalability of Merge Log Buffers [v5]

Thomas Schatzl tschatzl at openjdk.org
Tue Mar 12 14:12:16 UTC 2024


On Tue, 12 Mar 2024 13:54:26 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> src/hotspot/share/gc/g1/g1RemSet.cpp line 1313:
>> 
>>> 1311:           count += tail->size();
>>> 1312:           cur = tail->next();
>>> 1313:         }
>> 
>> Still good. Looking at this balancing code again, maybe a comment about that part ("// Balance dirty card buffers for better work distribution.") or factoring this out into a helper method for documentation purposes would be nice.
>> It just feels quite a bit of code in a constructor, but just a comment what this is doing is just fine. Or just ignore if you feel it is obvious.
>
> To me, the balancing code seems pretty obvious in the context of avoiding the bottleneck of a single
> list being processed by multiple threads.  But a comment about that bottleneck to explain all of this stuff
> around `_dirty_card_buffers` might be nice.

Fwiw, I marked a random location in this code as basically the entire constructor is about balancing. Just commenting `_dirty_card_buffers` is just fine too (and in general, explaining _why_ something is done is preferable to _what_ is done which when describing the former typically contains the latter anyway).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18134#discussion_r1521539422


More information about the hotspot-gc-dev mailing list