Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software
- Software Development Technologies
- Intel® ISA Extensions
- Real value of the CPU frequency when changed with IA32_CLOCK_MODULATION MSR

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

medinad

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-20-2009
04:34 AM

271 Views

Real value of the CPU frequency when changed with IA32_CLOCK_MODULATION MSR

I am working with MaRTE OS (a Hard RTOS with a Minimal RT POSIX.13 subset [marte webpage] ) and at a low level programing.

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.

There is a table whit the theoretical values in the specification 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.

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.

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.

How should I get the working-frequency??? Are there other methods?

I am a little cofused.

Thank you.

Daniel M.

theoretical - APERF/MPERF - TSC

1.000 - 1.000 - 1.000

0.875 - 0.877 - 0.853

0.750 - 0.760 - 0.708

0.625 - 0.638 - 0.568

0.500 - 0.538 - 0.448

0.375 - 0.434 - 0.325

0.250 - 0.363 - 0.239

0.125 - 0.270 - 0.132

Link Copied

1 Reply

EnioPineda

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-29-2009
08:16 AM

271 Views

Quoting - medinad

I am working with MaRTE OS (a Hard RTOS with a Minimal RT POSIX.13 subset [marte webpage] ) and at a low level programing.

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.

There is a table whit the theoretical values in the specification 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.

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.

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.

How should I get the working-frequency??? Are there other methods?

I am a little cofused.

Thank you.

Daniel M.

theoretical - APERF/MPERF - TSC

1.000 - 1.000 - 1.000

0.875 - 0.877 - 0.853

0.750 - 0.760 - 0.708

0.625 - 0.638 - 0.568

0.500 - 0.538 - 0.448

0.375 - 0.434 - 0.325

0.250 - 0.363 - 0.239

0.125 - 0.270 - 0.132

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.

In your case, if you know the nominal frequency then you can calculate the actual frequency:

frequency = duty_cycle * nominal_frequency.

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.

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.

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.

Enio.

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

For more complete information about compiler optimizations, see our Optimization Notice.