RFR: JDK-8297796 GenShen: instrument the remembered set scan [v12]

Y. Srinivas Ramakrishna ysr at openjdk.org
Wed Dec 21 17:43:22 UTC 2022


On Mon, 19 Dec 2022 23:52:39 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> src/hotspot/share/gc/shenandoah/shenandoahCardStats.hpp line 61:
>> 
>>> 59:     _cards_in_cluster(cards_in_cluster),
>>> 60:     _local_card_stats(card_stats),
>>> 61:     _last_dirty(false),
>> 
>> Should it always be the case that `_last_dirty != _last_clean`? Could we use one variable here instead of two?
>
> I believe we switch into one of two modes based on the first card we encounter. So there are 3 states: an initial (neither), and then subsequently either dirty or clean. So there are 3 states, which is 2 bits. It's possible I could shrink it to 1 bit with some cleverness, but figured I wouldn't try too hard as this is still all non-product. I'll think some more about it.

I re-examined the code with an eye to reducing the use of flags. Although I think it might be possible, I believe it would complicate the structure of the code a bit because of teh asymmetric treatment of clean and dirty. As things stand the symmetry of the treatment leads to more uniform and consistent code structure that makes the code more maintainable. We can revisit the reduction in state separately in the fullness of time.

I'll resolve this comment based on the above reasoning.

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

PR: https://git.openjdk.org/shenandoah/pull/176


More information about the shenandoah-dev mailing list