Wednesday, September 09, 2009

How to make Turbo Boost work under Linux

Just seen some funny accusation that Intel's Turbo Boost is broken, not working in Linux ... hence one need to turn of Turbo boost in running benchmarks ... and some wishes that AMD's implementation would 'fix' that bug ... and of course, this is from the AMFUDZone :)

Well, I'll just list down some simple short rules for any OS to run Turbo boost here;
  1. The said OS must support ACPI
  2. The BIOS in use must support ACPI
  3. EIST and Turbo Boost BIOS option must be turned on
  4. CState should be set
  5. The said OS must turn on its power management features, for both Pstates and Cstates
  6. The Pstate entries, P1 should be corresponding to the chip default frequency

Here are the brief explanations.

Turbo boost is enter through Pstate-0. Thus the system (BIOS and OS) must support ACPI and turn those options on. Turbo boost is guarded by thermal and power headroom, enabling (deeper) Cstate would help CPU running at higher frequency because headroom are likely available.

The sixth requirement is not quite obvious. I have personally seen a Linux variance kernel debug check if this is not fulfilled.

A side note on this is that there are also people claim that CPU running at higher frequence unnecessarily. Actually this is untrue. It is again depends on the user's choice of power policy. Take the Windows XP for example, if an user choose the power scheme "Home/Office Desk". The said CPU(s) would run at Pstate-0 most of the time (except when entering enhanced Cstate which it would reduce to lower Pstate before idle). The CPU would be under Turbo Boost most of the time. But this make little different. If the given CPU does not support Turbo boost, it would be under its default max frequency with this setting anyway. If one has a concern on this, one could just use the power scheme "Portable/Laptop", like I did, even with a desktop system. Then when you are doing light work, your system would just run with lower Pstate, and enter Turbo during high load.

Then the usual accusation saying this waste power for server when it is idleing most the time ... wait, if one would have to enable Turbo Boost on server, and has concern with power ... should not one turn on the power saving policy so that enter lower Pstate on low usage ??? :) Anyway, I am not a system admin, not sure about the server power policy, feel free to correct me, either with your experience, or known data. If you were to share your viewpoint/guess, please add words like such as "think/guess", or put the statement in the form of question like I did :)

Then the even funny statement on why one would buy a CPU with Turbo Boost and should turn it off, because want Consistent Results or claiming With turbo mode, the additional clock rates is not guaranteed " ... and those are likely the same folks would turn on their CnQ :)

9 comments:

Scientia from AMDZone said...

Turbo is overclocking for the average person (who of course does not know how to overclock). As a consumer feature it is admirable. However, I might point out that Asus motherboards have Turbo V and Turbo Key which are also pretty easy to do for someone not familiar with overclocking. Other mobo makers have similar tools. I'll agree that AOD would be a bit daunting for the average user and BIOS adjustments would be out of the question.

Turbo has nothing to do with Cool and Quiet which is designed to clock down and save power. For example, even with my X3 720 running overclocked at 3.4 Ghz it will still clock down to 800, 1600, or 2400 Mhz when there is less load. Personally, I've never seen anything beyond a tiny difference when running benchmarking with CnQ turned on. So, I have to wonder how Anandtech managed to completely botch their testing supposedly because of CnQ. Maybe they had an early implementation which didn't work right. Or maybe they fudged the results and then used that as an excuse. Hard to tell.

Your article might be quite helpful to someone using i5/i7 with Linux. If you are running an i5/i7 then some information about your overclocking experiences might be nice. I've included my X3 720 experiences on my blog.

pointer said...

Blogger Scientia from AMDZone said...

Turbo is overclocking for the average person (who of course does not know how to overclock). As a consumer feature it is admirable.


If 'correctness' can be rated from 0 to 10, I give your statement a 2.5 score :).

1) Let's look at the Turbo Boost ratio directly: W:X:Y:Z, with W being ratio boost during single core and V being base clock ratio. If W=X=Y=Z and W!=0, then it really looks like 'overclocking' although a factory gurantee one and still differ in such clock ratio under Pstate P0 would be from V to V+W. Let's compare this to a system OC to base clock ratio V+W, without Turbo Boost on and quote a corner case here. Assuming Prime95 will not be stable with V+W ratio. But by all mean, as long as Prime95 is stable with clock ratio V, the Prime95 WILL be stable with system base clock ratio V with Turbo ratio W as most of the time during Prime95 running, the system would run with clock ratio V. When the user use other application not as demanding, the system would run at clock ratio V+W.

2) Yet, for all released CPU with the Turbo Boost support so far, the W>X and X could be > Y. Thus it helps with light threaded apps to boost better. I know you have argued why one buy quad core but run with light threaded apps. But it is a reality, light threaded apps continiue to exist, be it due to legacy, software engineer experience, inheritly serial algorithm, etc.

3) Mobile segment. Imagine intel could put a very small V, but a big W. This really help the TDP while the said CPU is good in single threaded and multithreaded apps!


However, I might point out that Asus motherboards have Turbo V and Turbo Key which are also pretty easy to do for someone not familiar with overclocking. Other mobo makers have similar tools. I'll agree that AOD would be a bit daunting for the average user and BIOS adjustments would be out of the question.

Yes, there are some other dynamic clock changes method existed one way aother, be it changing the base frequency or the ratio. I think the CPU one has much more fine grain control and thus stable.

Turbo has nothing to do with Cool and Quiet which is designed to clock down and save power. For example, even with my X3 720 running overclocked at 3.4 Ghz it will still clock down to 800, 1600, or 2400 Mhz when there is less load. Personally, I've never seen anything beyond a tiny difference when running benchmarking with CnQ turned on. So, I have to wonder how Anandtech managed to completely botch their testing supposedly because of CnQ. Maybe they had an early implementation which didn't work right. Or maybe they fudged the results and then used that as an excuse. Hard to tell.


No, actually both involve change of frequency and a tiny delay between upwards switches. As long as one has the same configuration running, both can yield consistent result statistically in long run. There is a performance difference albeit small by turning on the power management. I was just laughing at those fanboish statement, claim one should turn off a CPU feature with funny reason in which their favorite CPU does not support (yet).

Your article might be quite helpful to someone using i5/i7 with Linux. If you are running an i5/i7 then some information about your overclocking experiences might be nice. I've included my X3 720 experiences on my blog.

I have not OC'ed my i7 system yet for a reason that I cannot disclose or else my peers would know who I am :)

Anonymous said...

I wish not agree on it. I assume precise post. Particularly the title-deed attracted me to be familiar with the unscathed story.

Anonymous said...

Opulently I to but I dream the collection should acquire more info then it has.

Anonymous said...

Easily I agree but I about the post should acquire more info then it has.

Anonymous said...

Turbo Boost & Intel Speed Step
Both Operate independent of the OS. In-fact you don't even need to boot into an OS for Turbo Boost & Intel Speed Step to work.

However, they both can be controlled by the OS. It dose seem that the Turbo Boost will not bump it up to the Max by default in Linux though. I don't know why. My guss is some setting in the Kernel that everyone has forgotten about.

In any case, the solution to the problem is also a little strange but it works 100%. Just install cpufreq and use the default "Performance" setting.

Read more on my server about it here...

Linux and Nehalem Architecture
https://fermioncloud.com/?p=86

Weezilla said...

I'm building a computer for astrophysics simulations which will run Linux. Do you think I will be able to get Turbo Boost to work in Linux without too much trouble?

pointer said...

No issue with that. Like what I stated, the support comes in naturally with proper BIOS support and OS ACPI.

mickliddy said...

A side note on this is that there are also people claim that CPU running at higher frequence unnecessarily. Actually this is untrue.

Well, actually it's only partially true. It's fine to have a processor run faster but your bottlenecks lie in accessing data from cache, RAM or (god forbid) a HDD. If you have a 4M cache with 8M of data to process, increasing your processors speed will have limited impact - it will simply mean your processor has more wasted clock cycles due to waiting for data.
If you're processing smaller amounts of data (the general case) the increase in speed is useful. You can apply Amdahl's law to show this.

However, keep in mind; user applications are becoming more data reliant. 4G of RAM is common now and 6M cache is mid-range. Cache capacities are regularly exceeded by many user applications now and even push the limit of RAM on occasion. That's why processors haven't really gained higher clock-speeds over the past few year and yet still get faster.