Software Tuning, Performance Optimization & Platform Monitoring
Discussion regarding monitoring and software tuning methodologies, Performance Monitoring Unit (PMU) of Intel microprocessors, and platform updating.

DISABLE turbo boost

Wei_K_
Beginner
1,495 Views

Hi, All,

first of all, I always write my own driver when I need to read something from the model-specify register and I am successfully read some PMU counters before, say for instruction retired, cache misses and so on.

Recently I am conducting experiment using SPECCPU2006 benchmark and I notice the running time varies (larger than 10%) for different round. the program usually run faster iteration by iteration. I suspect that turbo boost may did the trick. In order to reproduce the same execution time, I need it to run without having freq changes. I did some search and noticed that by modify the register 0x1A0 from 0x850089 to 0x4000850089 can set the turbo boost off, in other word, set the bit 38 to 1 can disable turbo boost. So I first read the content from 0x1A0 and then set it to 0x4000850089 and write back. I am aware that I may need to do this for each core.

after that, I re-read the value, I found:

core0: 0x4000850089

core1: 0x4000850089

core2: 0x0

core3: 0x4000850089

and I test my benchmarks, it still run faster after iterations. (I pin the benchmark running on core0 using taskset -c 0 ./benchmark_script )

So my question is: is it possible that the os can re-write the msr so I cannot turn off turbo boost forever? Am i wrong on modify the turbo boost.

other thing is: any suggestion for the program execution time other than turbo boost? say smart cache technology? prefetcher? I am not expert on this side so any suggestion and idea are welcome

 

By the way, my machine is intel i7-920 (Nehelam) and os is linux centos5.10. I go into my bios and can only disable speedstep and it didn't have any turbo boost option for me to enable/disable in bios. And this cpu do have turbo boost feature in it.

Thanks in advance.

 

0 Kudos
1 Reply
McCalpinJohn
Honored Contributor III
1,495 Views

It is best to use the OS options to control frequency if they are available.   On Linux systems this is usually via the "acpi-cpufreq" loadable kernel module and its associated files.   I don't know if this existed as far back as Centos 5.10, but it is certainly supported in Centos 6 & 7.

If the "acpi-cpufreq" module is loaded, then for each core (${P}) you want to execute these two commands:

echo "userspace" >/sys/devices/system/cpu/cpu${P}/cpufreq/scaling_governor

echo [frequency_in_kHz] > /sys/devices/system/cpu/cpu${P}/cpufreq/scaling_setspeed

On some systems the BIOS retains control of the frequencies, in which case the "acpi-cpufreq" module will probably not be loaded and you will need to find the magic BIOS option to tell it to give frequency control back to the OS.

0 Kudos
Reply