RFR: 8214315: G1: fatal error: acquiring lock SATB_Q_FL_lock/1 out of order with lock tty_lock/0

Erik Österlund erik.osterlund at oracle.com
Fri Dec 7 07:38:49 UTC 2018


Hi Kim,

Looks good.

Thanks,
/Erik

On 2018-12-07 07:31, Kim Barrett wrote:
> Please review this change to the lock rank for the tty_lock.  We
> introduce a new lock rank 'tty', which is placed below the 'special'
> rank but above the 'access' ranks.  This new rank is used only by the
> tty_lock, which formerly had 'event' rank.
> 
> This eliminates a rare lock rank inversion in nmethod::log_new_method,
> where the tty_lock is locked around a resolve of a jweak.  That
> resolve could require allocating a SATB buffer or enqueuing a full
> one, either of which will attempt to lock an 'access' mutex.  With the
> old ranks, that 'access' mutex has higher rank than the already owned
> tty_lock, asserting in a debug build, and potentially deadlocking in a
> product build.  (The deadlock scenario seems unlikely; see JDK-8214997
> for a related scenario.)
> 
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8214997
> 
> Webrev:
> http://cr.openjdk.java.net/~kbarrett/8214315/open.00/
> 
> Testing:
> mach5 tier1-5
> 


More information about the hotspot-dev mailing list