Request for review: 6888526 Linux getCurrentThreadCpuTime is drastically slower than Windows

David Holmes David.Holmes at oracle.com
Wed Jul 7 21:34:58 PDT 2010


Daniel D. Daugherty said the following on 07/08/10 09:03:
> The official configurations are listed here:
> 
> http://java.sun.com/javase/6/webnotes/install/system-configurations.html
> 
> but I don't know how to translate the various Linux versions
> into something that would help resolve this issue.

The functionality should be supported in all 2.6.16+ kernels, and 
potentially supported in 2.6.10+ with appropriate patches - but, like 
Dan, I have no way to know what kernel versions the supported Linux 
distros actually have.

Because we dynamically check for the supported functionality this should 
not cause a problem as we will fall-back to using "slow clocks" if they 
aren't present.

I agree it is time to change this default, but note that we need to 
mention this in the release notes somewhere and, more importantly, we 
need to ensure there is extensive testing here because we may be using 
OS functionality that has hitherto been unused (or little used) and we 
may encounter bugs in that functionality (bugs in the OS? surely not! ;-))

Further, as Dan mentions, this would then affect Java 6 updates and that 
is not allowed (without additional 'paperwork') so we'd have to augment 
Arguments::parse_each_vm_init_arg in arguments.cpp by adding to the end:

  if (JDK_Version::current().compare_major(6) <= 0 &&
       FLAG_IS_DEFAULT(UseLinuxPosixThreadCPUClocks)) {
     FLAG_SET_DEFAULT(UseLinuxPosixThreadCPUClocks, false);
   }

this forces the flag to false in Java 6 unless it has been set explicitly.

Cheers,
David Holmes

> Dan
> 
> 
> 
> On 7/7/2010 4:56 PM, Daniel D. Daugherty wrote:
>> Andrew,
>>
>> I concur that it is time to change the default value for this flag
>> so thumbs up on the webrev.
>>
>> My only worry is about HSX-19 deliveries into JDK-Updates. I'll
>> poke around and see if I can find a statement about the minimum
>> Linux that is supported.
>>
>> The majority of the JVM/TI relevant tests are internal so those
>> won't do you much good. If you push this change to
>>
>>     http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot
>>
>> a.k.a. RT_Baseline, I can keep an eye on the internal test results.
>>
>> Dan
>>
>>
>> On 7/7/2010 11:33 AM, Andrew Haley wrote:
>>> The evaluation says:
>>>
>>> "As the submitter notes the functionality exists but is disabled by
>>> default. The user can easily enable it by specifying
>>> -XX:+UseLinuxPosixThreadCPUClocks
>>>
>>> "The functionality was added for JDK 6 under CR 6200022 but there was
>>> concern at the time about enabling it by default (those concerns are
>>> not documented in 6200022).
>>>
>>> "Perhaps it is time to enable this feature by default?"
>>>
>>> I changed the default for this parameter to true.
>>>
>>> I tested this change on an older Linux system that does not have the
>>> high-speed thread clock interface (Red Hat Enterprise Linux AS release
>>> 4, kernel 2.6.9).  The test case still works, but slowly.
>>>
>>> On a more recent system (Fedora 12, kernel 2.6.31) the test case is
>>> much speeded up.
>>>
>>> Is there any more testing that I should do?
>>>
>>> Patch at http://cr.openjdk.java.net/~aph/6888526/
>>>
>>> OK to push?
>>>
>>> Andrew.
>>>   
>>


More information about the hotspot-dev mailing list