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

Kim Barrett kim.barrett at oracle.com
Fri Dec 7 06:31:52 UTC 2018

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.)



mach5 tier1-5

More information about the hotspot-dev mailing list