topic Real value of the CPU frequency when changed with IA32_CLOCK_MODULATION MSR in IntelĀ® ISA Extensions
https://community.intel.com/t5/Intel-ISA-Extensions/Real-value-of-the-CPU-frequency-when-changed-with-IA32-CLOCK/m-p/899418#M2766
Hello,<BR /><BR />I am working with MaRTE OS (a Hard RTOS with a Minimal RT POSIX.13 subset [<A title="MaRTE webpage" href="http://marte.unican.es">marte webpage</A>] ) and at a low level programing.<BR /><BR />I use IA32_CLOCK_MODULATION MSR to change the CPU frecuency. It allows to me to modulate the dutycycle of the on-demand clock. The dutycycle field encoding is 3 bits. Then, I have a set of fixed dutycycle values.<BR /><BR />There is a table whit the theoretical values in the <A href="http://www.intel.com/products/processor/manuals/">specification </A>vol 3A Chap 13 page 13-16 . And two ways to get the real working-frequency. A) get the time that a well-defined loop take to complete at different frequencies, and B) use IA32_MPERF MSR and IA32_APERF MSR (Chap 13, page 13-2) which division is the ratio of the processor frequency.<BR /><BR />But I find significant differencies between both methods and the theoretical values (show in table below). I trust more in tsc than in aperf/mperf ratio. But I would like to use last method because it involve less time to know the ratio.<BR /><BR />On the other hand, I do not sure that the ratio provided by APERF/MPERF division is really of the frequency. And I need to know the frequency as accuracy as possible due to real time purposes. <BR /><BR />How should I get the working-frequency??? Are there other methods?<BR />I am a little cofused.<BR /><BR />Thank you.<BR />Daniel M.<BR /><BR /><BR />theoretical - APERF/MPERF - TSC<BR />1.000 - 1.000 - 1.000<BR />0.875 - 0.877 - 0.853<BR />0.750 - 0.760 - 0.708<BR />0.625 - 0.638 - 0.568<BR />0.500 - 0.538 - 0.448<BR />0.375 - 0.434 - 0.325<BR />0.250 - 0.363 - 0.239<BR />0.125 - 0.270 - 0.132Wed, 20 May 2009 11:34:57 GMTmedinad2009-05-20T11:34:57ZReal value of the CPU frequency when changed with IA32_CLOCK_MODULATION MSR
https://community.intel.com/t5/Intel-ISA-Extensions/Real-value-of-the-CPU-frequency-when-changed-with-IA32-CLOCK/m-p/899418#M2766
Hello,<BR /><BR />I am working with MaRTE OS (a Hard RTOS with a Minimal RT POSIX.13 subset [<A title="MaRTE webpage" href="http://marte.unican.es">marte webpage</A>] ) and at a low level programing.<BR /><BR />I use IA32_CLOCK_MODULATION MSR to change the CPU frecuency. It allows to me to modulate the dutycycle of the on-demand clock. The dutycycle field encoding is 3 bits. Then, I have a set of fixed dutycycle values.<BR /><BR />There is a table whit the theoretical values in the <A href="http://www.intel.com/products/processor/manuals/">specification </A>vol 3A Chap 13 page 13-16 . And two ways to get the real working-frequency. A) get the time that a well-defined loop take to complete at different frequencies, and B) use IA32_MPERF MSR and IA32_APERF MSR (Chap 13, page 13-2) which division is the ratio of the processor frequency.<BR /><BR />But I find significant differencies between both methods and the theoretical values (show in table below). I trust more in tsc than in aperf/mperf ratio. But I would like to use last method because it involve less time to know the ratio.<BR /><BR />On the other hand, I do not sure that the ratio provided by APERF/MPERF division is really of the frequency. And I need to know the frequency as accuracy as possible due to real time purposes. <BR /><BR />How should I get the working-frequency??? Are there other methods?<BR />I am a little cofused.<BR /><BR />Thank you.<BR />Daniel M.<BR /><BR /><BR />theoretical - APERF/MPERF - TSC<BR />1.000 - 1.000 - 1.000<BR />0.875 - 0.877 - 0.853<BR />0.750 - 0.760 - 0.708<BR />0.625 - 0.638 - 0.568<BR />0.500 - 0.538 - 0.448<BR />0.375 - 0.434 - 0.325<BR />0.250 - 0.363 - 0.239<BR />0.125 - 0.270 - 0.132Wed, 20 May 2009 11:34:57 GMThttps://community.intel.com/t5/Intel-ISA-Extensions/Real-value-of-the-CPU-frequency-when-changed-with-IA32-CLOCK/m-p/899418#M2766medinad2009-05-20T11:34:57ZRe: Real value of the CPU frequency when changed with IA32_CLOC
https://community.intel.com/t5/Intel-ISA-Extensions/Real-value-of-the-CPU-frequency-when-changed-with-IA32-CLOCK/m-p/899419#M2767
<DIV style="margin:0px;">
<DIV id="quote_reply" style="width: 100%; margin-top: 5px;">
<DIV style="margin-left:2px;margin-right:2px;">Quoting - <A href="https://community.intel.com/en-us/profile/425015">medinad</A></DIV>
<DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"><EM>Hello,<BR /><BR />I am working with MaRTE OS (a Hard RTOS with a Minimal RT POSIX.13 subset [<A title="MaRTE webpage" href="http://marte.unican.es">marte webpage</A>] ) and at a low level programing.<BR /><BR />I use IA32_CLOCK_MODULATION MSR to change the CPU frecuency. It allows to me to modulate the dutycycle of the on-demand clock. The dutycycle field encoding is 3 bits. Then, I have a set of fixed dutycycle values.<BR /><BR />There is a table whit the theoretical values in the <A href="http://www.intel.com/products/processor/manuals/">specification </A>vol 3A Chap 13 page 13-16 . And two ways to get the real working-frequency. A) get the time that a well-defined loop take to complete at different frequencies, and B) use IA32_MPERF MSR and IA32_APERF MSR (Chap 13, page 13-2) which division is the ratio of the processor frequency.<BR /><BR />But I find significant differencies between both methods and the theoretical values (show in table below). I trust more in tsc than in aperf/mperf ratio. But I would like to use last method because it involve less time to know the ratio.<BR /><BR />On the other hand, I do not sure that the ratio provided by APERF/MPERF division is really of the frequency. And I need to know the frequency as accuracy as possible due to real time purposes. <BR /><BR />How should I get the working-frequency??? Are there other methods?<BR />I am a little cofused.<BR /><BR />Thank you.<BR />Daniel M.<BR /><BR /><BR />theoretical - APERF/MPERF - TSC<BR />1.000 - 1.000 - 1.000<BR />0.875 - 0.877 - 0.853<BR />0.750 - 0.760 - 0.708<BR />0.625 - 0.638 - 0.568<BR />0.500 - 0.538 - 0.448<BR />0.375 - 0.434 - 0.325<BR />0.250 - 0.363 - 0.239<BR />0.125 - 0.270 - 0.132</EM></DIV>
</DIV>
</DIV>
<BR />I could be wrong, but I don't think the APERF/MPERF ratio is a frequency ratio. It's more like actual processor performance over the measurement interval. If the ratio is < 1 then the processor is operating at less than its rated performance. If the ratio is == 1 then the processor is operating at its rated performance. If the ratio is > 1 then the processor is operating at higher than its rated performance.<BR /><BR />In your case, if you know the nominal frequency then you can calculate the actual frequency:<BR />frequency = duty_cycle * nominal_frequency. <BR />For example, if the nominal frequency is 1GHz and you've set IA32_CLOCK_MODULATION to achieve a .750 duty cycle then the actual frequency should be 750MHz.<BR /><BR />Of course, as soon as the processor is idle (C1 or higher) the frequency goes to zero. Things like Intel Dynamic Acceleration and Turbo Boost (if enabled) can increase the frequency if conditions allow it. Things like Thermal Monitoring can reduce the frequency when needed.<BR /><BR />Unless all power management mechanisms in the processor are turned off, it is almost impossible to know the actual frequency at any given point in time. That's why the APERF/MPERF ratio is useful - you can observe the actual performance over a period of time and adjust it up or down (via P-State or throttling) to meet the required performance target.<BR /><BR />Enio.<BR />Fri, 29 May 2009 15:16:18 GMThttps://community.intel.com/t5/Intel-ISA-Extensions/Real-value-of-the-CPU-frequency-when-changed-with-IA32-CLOCK/m-p/899419#M2767EnioPineda2009-05-29T15:16:18Z