RFR: JDK-8305334: GenShen: reference processing needs a card-marking barrier

Y. Srinivas Ramakrishna ysr at openjdk.org
Fri Mar 31 02:33:53 UTC 2023


On Fri, 31 Mar 2023 01:00:18 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> Let me look into this a bit more closely, in regards to how the card-scanning code treats the traversal of weak pointers.
>> 
>> In other words, it must either be the case that the card-mark done in the code you pointed out above (in `drop`) is not needed or, if it is needed, then at least my comment (and attendant assertion at lines 81 & 82) below is wrong and needs to be suitably adjusted and retested:
>> 
>>         Those cards will continue to
>>     // remain dirty on account of this cross-generational pointer to the referent.
>> 
>> 
>> I'll update after looking into this more closely. (I'll also then see if the code can be shared like you asked.)
>
> A visual examination of the card-scanning code reveals that the card-mark in the portion of code you pointed out is redundant because the card-scanning code always dirties the card containing a cross-generational pointer, irrespective of whether it's a weak or strong pointer. I'll work on eliding that unnecessary check and mark in a separate PR as I want to add some assertions and check it carefully.
> 
> Thanks for drawing my attention to this code which I had just glossed over before.
> 
> The diffs in my original PR stay unchanged and I'll not try to do anything about sharing the code, since I expect that piece of card-marking code in `drop()` to go away in the PR I promised above, for which I'll open a ticket momentarily.

I opened https://bugs.openjdk.org/browse/JDK-8305335 to follow up on that.

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

PR Review Comment: https://git.openjdk.org/shenandoah/pull/238#discussion_r1153952419


More information about the shenandoah-dev mailing list