Hi Michal -- Thanks so much for the patch... (hopefully you have or will complete the contributor agreement that will allow the patch to be used). I will definitely try and review the patch over the next day or two as soon as i find a few spare cycles.<br>
<br>thanks!<br>-- ramki<br><br><div class="gmail_quote">On Mon, Aug 27, 2012 at 10:17 AM, Michal Frajt <span dir="ltr"><<a href="mailto:michal@frajt.eu" target="_blank">michal@frajt.eu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div><div>Hi Ramki / Jon, </div>
<div> </div>
<div>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.</div>
<div> </div>
<div>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).</div>
<div> </div>
<div>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.</div>
<div> </div>
<div>Regards,</div>
<div>Michal </div></div>
</div>
</blockquote></div><br>