Restrictions for lock coarsening?

Christian Thalinger christian.thalinger at gmail.com
Thu Jan 8 15:33:03 PST 2009


On Fri, 2009-01-09 at 08:27 +1000, David Holmes - Sun Microsystems
wrote:
> During startup a lot of locks get touched by many threads so a lot of 
> bias revocation occurs and that requires a safepoint each time. So 
> basically the system spends a lot of time at safepoints and that adds a 
> lot of overhead.
> 
> Also note, as I understand from work I did late in the Java 6 cycle, 
> once an object has its biased revoked it remains revoked ie it will not 
> participate in biased-locking again. This was done to prevent 
> "thrashing" and it also makes things easier to reason about.

Looking at bulk_revoke_or_rebias_at_safepoint(), it seems you're right.
Even worse.  All future instances of a class cannot use biased locking,
as this comment states:

    // Disable biased locking for this data type. Not only will this
    // cause future instances to not be biased, but existing biased
    // instances will notice that this implicitly caused their biases
    // to be revoked.

Or am I wrong?

- Christian




More information about the hotspot-runtime-dev mailing list