CMS parallel initial mark; vm thread sneaking in Thread::try_lock()
thomas.schatzl at oracle.com
Mon Jun 10 12:49:54 PDT 2013
On Fri, 2013-06-07 at 11:28 -0700, Jon Masamitsu wrote:
> On 6/7/2013 4:23 AM, Thomas Schatzl wrote:
> > - the code to get the lock on _eden_chunk_sampling_active seems to be
> > needlessly complicated.
> > Please consider using a dedicated Monitor in conjunction with
> > try_lock(). I.e.
> Any concerns about the "sneak" code in try_lock()? That would only
> matter if the VM thread were involved in the eden sampling along with
> other GC threads, yes?
I do not think so in this case. Only the VM thread can sneak, and only
during safepoint. The sampling is done only for eden space and eventually
from-space, which are never allocated to during gc (only by java threads
outside of stw pauses), aren't they?
The code could assert that in the sampling too.
Even then, this sampling is only active for defnew at the moment. The
only thread that is active in a defnew collection is the vm thread where
sneaking cannot happen.
More information about the hotspot-runtime-dev