RFR (9) 8185133: Reference pending list root might not get marked

Mikael Gerdin mikael.gerdin at oracle.com
Tue Aug 1 08:54:41 UTC 2017


Hi Thomas,

On 2017-07-31 15:25, Thomas Schatzl wrote:
> Hi,
> 
> On Fri, 2017-07-28 at 14:52 -0400, Kim Barrett wrote:
>>>
>>> On Jul 28, 2017, at 8:50 AM, Mikael Gerdin <mikael.gerdin at oracle.co
>>> m> wrote:
>>>
>>> Hi all,
>>>
>>> Please review this fix to a tricky reference processing / conc
>>> marking bug affecting G1 in 9.
>>>
>>> The bug occurs when a weak reference WR is promoted to old
>>> and[...] My suggested fix is to explicitly mark the reference
>>> pending list
>>> head oop during initial mark, after the reference enqueue phase.
>>> This mirrors how other roots are handled in initial mark, see
>>> G1Mark::G1MarkPromotedFromRoots.
>>>
>>> Webrev: http://cr.openjdk.java.net/~mgerdin/8185133/webrev.0
>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8185133
>>>
>>> Testing: JPRT, tier2-5 gc tests, a LOT of runs of the failing test.
>>>
>>> Many thanks to Kim and Erik Ö for discussions around this issue!
>>>
>>> Thanks
>>> /Mikael
>> -------------------------------------------------------------------
>> -----------
>> src/share/vm/memory/universe.cpp
>>   499 oop Universe::reference_pending_list() {
>>   500   if (Thread::current()->is_VM_thread()) {
>>   501     assert_pll_locked(is_locked);
>>   502   } else {
>>   503     assert_pll_ownership();
>>   504   }
>>   505   return _reference_pending_list;
>>   506 }
>>
>> I was afraid that conditionalization might be needed.
>>
>> I think I'd like distinct readers for the different locking context
>> use cases.  However, I'd be fine with such a distinction being
>> deferred to JDK 10.
>>
> 
> Agree with that this code looks ugly, I agree with Kim that fixing this
> can wait. Looks good, and great work.

Thanks for the review.
/Mikael

> 
> Thomas
> 



More information about the hotspot-gc-dev mailing list