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

Jesper Wilhelmsson jesper.wilhelmsson at oracle.com
Tue Sep 25 14:16:14 UTC 2012

Hi Michal,

Thank you for your contribution! I have attached your patches to CR 7189971.

As Ramki mentioned in his mail, you need to complete the contributor agreement 
before we can use the patch. Once this is done we can have a look at the 
patches and find someone to shepherd the change.

It's not as easy as just applying the patches though. To avoid creating a 
regression from JDK 7 to JDK 8 we need to fix the problem in the current hsx 
repositories first and then backport it to 7u and 6.


On 2012-08-30 10:05, Srinivas Ramakrishna wrote:
> 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.
> thanks!
> -- ramki
> On Mon, Aug 27, 2012 at 10:17 AM, Michal Frajt <michal at frajt.eu 
> <mailto:michal at frajt.eu>> wrote:
>     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.org/pipermail/hotspot-gc-dev/attachments/20120925/b96b2de5/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jesper_wilhelmsson.vcf
Type: text/x-vcard
Size: 251 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20120925/b96b2de5/jesper_wilhelmsson.vcf>

More information about the hotspot-gc-dev mailing list