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 :)