[PATCH] 7189971: Implement CMSWaitDuration for non-incremental mode of CMS

Michal Frajt michal at frajt.eu
Mon Aug 27 17:17:40 UTC 2012


Hi Ramki / Jon, 
 
Please find the patch for the CMSWaitDuration unstable behavior issue. The patch keeps the method wait_on_cms_lock untouched for the calls from the abortable_preclean phase (not very correct behaviour but still acceptable for the abortable preclean 'short break' calls between the preclean work iterations). The new method wait_on_cms_lock_for_scavenge has been added. The method monitors the CGC_lock for notifications, handles the full wait time interval, checks the scavenge occurrence by the total_collections counter changing its value. When reviewing please mind that the allowed locking order in the CMS thread should be FreelistHolder -> Heap_lock -> CGC_lock (based on a source code comment but the collect_in_background method is using reverted order between the Freelist and the Heap_lock ??). The sleepBeforeNextCycle method is now using the new wait_on_cms_lock_for_scavenge method for both the normal and the incremental CMS mode.
 
The patch has been prepared for the openjdk6 and openjdk7u. The openjdk6 got compiled and tested on solaris-amd64 platform. The openjdk7u got compiled without much testing (we have jdk6 application environment only).
 
You additionally suggested to have an explicit flag such as CMSScavengeBeforeInitialMark. I already replied to it but it did not get into the posting list (sent from another email address). The idea of the CMSScavengeBeforeInitialMark could be easier to implement but we strongly prefer not to invoke yet another scavenge explicitly as it is unbalancing young objects aging and leads to unwanted promotions. I could think about a combined solution when it first waits for the CMSWaitDuration and, if there is no scavenge occurring, it is explicitly invoking a scavenge before the inital-mark phase (or better pause) starts.
 
Regards,
Michal 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20120827/a0893406/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openjdk6-hostspot-7189971.patch
Type: application/octet-stream
Size: 4421 bytes
Desc: not available
URL: <https://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20120827/a0893406/openjdk6-hostspot-7189971.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openjdk7u-hostspot-7189971.patch
Type: application/octet-stream
Size: 4421 bytes
Desc: not available
URL: <https://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20120827/a0893406/openjdk7u-hostspot-7189971.patch>


More information about the hotspot-gc-dev mailing list