RFR: 8221392: Reduce ConcurrentGCThreads spinning during start up

Per Liden per.liden at oracle.com
Mon Mar 25 10:01:49 UTC 2019


Great! Thanks for testing Claes!

/Per

On 3/25/19 10:53 AM, Claes Redestad wrote:
> Hi,
> 
> just a comment: I ran this through a few OOTB startup tests on my laptop
> (so G1 etc) and can see a statistically significant (8%) reduction in
> context switches and small improvements on various other metrics. Great!
> 
> Thanks!
> 
> /Claes
> 
> On 2019-03-25 09:36, Per Liden wrote:
>> During startup, ConcurrentGCThreads end up in a loop sleeping for 1ms 
>> over and over (typically 30-50 times), until is_init_completed() is 
>> true. This is not optimal, and we should instead have them wait until 
>> they are signaled. This problem has been observed before, as comments 
>> in JDK-8136854 suggests.
>>
>> This patch introduces wait_init_completed(), which will block until 
>> set_init_completed() is called. Note that the newly introduced 
>> InitCompleted_lock is only used to control the interaction between 
>> wait_init_completed() and set_init_completed(). is_init_completed() is 
>> still lock-free and was just cleaned up to use proper atomic 
>> load_acquire/release_store semantics.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8221392
>> Webrev: http://cr.openjdk.java.net/~pliden/8221392/webrev.0
>>
>> /Per



More information about the hotspot-gc-dev mailing list