RFR: 8234426: Sweeper should not CompiledIC::set_to_clean with ICStubs for is_unloading() nmethods

Roman Kennke rkennke at redhat.com
Fri Nov 22 12:03:01 UTC 2019


We also see a problem that might be related to this with Shenandoah.
I'll test your change and see if it resolves that problem.

Thanks,
Roman


> Hi,
> 
> When the sweeper processes an nmethod, it will clean inline caches if it
> is_alive().
> Today, the cleaning will utilize transitional states (using ICStubs) if
> the nmethod is_alive(),
> which is always true for the sweeper. If it runs out of ICStubs, it
> might have to safepoint
> to refill them. When it does, the currently processed nmethod might be
> is_unloading().
> That is not a problem for the GC per se (safepoint operation fusing with
> mark end), but it
> is a problem for heap walkers that get confused that an nmethod
> reachable from a thread is unloading
> and hence has dead oops in it. This sweeper nmethod is the *only*
> nmethod that violates an
> invariant that nmethods reachable from threads (Thread::nmethods_do) are
> not unloading.
> 
> By simply changing the condition to not use ICStubs when the nmethod
> is_unloading(), we
> get this neat invariant, and code gets less confused about this.
> 
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8234426
> 
> Webrev:
> http://cr.openjdk.java.net/~eosterlund/8234426/webrev.00/
> 
> Thanks,
> /Erik
> 



More information about the hotspot-dev mailing list