RFR (S) 8160539: Stack frame scanning acquires several mutexes

David Holmes david.holmes at oracle.com
Tue Mar 26 00:34:07 UTC 2019


Hi Coleen,

On 26/03/2019 3:49 am, coleen.phillimore at oracle.com wrote:
> Summary: Use CAS instead of OopMapCacheAlloc_lock
> 
> Tested with hs-tier1-5 and specjbb2017.
> 
> open webrev at http://cr.openjdk.java.net/~coleenp/2019/8160539.01/webrev
> bug link https://bugs.openjdk.java.net/browse/JDK-8160539

How expensive is it to create OopMapCache? Are we likely to encounter a 
lot of contention on this?

As I mentioned in my reply to Dean I think it mildly preferable to use 
cmpxchg if you want to use the value in case you lose the race:

OopMapCache * temp = Atomic::cmpxchg(oop_map_cache, &_oop_map_cache, NULL)
if (temp != NULL) {
   // Some other thread won.
   delete oop_map_cache;
   oop_map_cache = temp;
}

Thanks,
David

> Thanks,
> Coleen


More information about the hotspot-dev mailing list