RFR(S) 8176363: Incorrect lock order for G1 PtrQueue related locks

Thomas Schatzl thomas.schatzl at oracle.com
Thu Mar 9 09:42:03 UTC 2017


Hi Mikael,

On Wed, 2017-03-08 at 15:16 +0100, Mikael Gerdin wrote:
> Hi all,
> 
> Please review this change to the lock rank of the locks taken in the
> G1 pre and post write barriers.
> 
> The rank of these locks have long been a problem since even though
> they are leaf locks semantically they have been ranked as "nonleaf"
> locks in the lock rank system and this has caused several issues over
> the years where a thread holding a VM mutex and attempting to write
> an oop would in some rare cases hit a deadlock warning due to it
> acquiring one of the CBL monitors.
> 
> Now this problem has come up yet again with the weak JNI handles
> bugfix where a lock rank assertion was hit yet again due to the fact
> that some code was holding a leaf lock while resolving a weak JNI
> handle.
> 
> I suggest that the ranks of the involved locks are changed to "leaf -
> 1", allowing them to be acquired by threads holding "leaf" locks. 

Looks good to me.

Thomas



More information about the hotspot-dev mailing list