ondemand: Solve a big performance issue by counting IOWAIT time as busy
authorArjan van de Ven <arjan@linux.intel.com>
Sun, 9 May 2010 15:26:06 +0000 (08:26 -0700)
committerIngo Molnar <mingo@elte.hu>
Sun, 9 May 2010 17:35:27 +0000 (19:35 +0200)
commit6b8fcd9029f217a9ecce822db645e19111c11080
tree1754333ce16418b5ffffddc75bfa1f0bf486f09f
parent0224cf4c5ee0d7faec83956b8e21f7d89e3df3bd
ondemand: Solve a big performance issue by counting IOWAIT time as busy

The ondemand cpufreq governor uses CPU busy time (e.g. not-idle
time) as a measure for scaling the CPU frequency up or down.
If the CPU is busy, the CPU frequency scales up, if it's idle,
the CPU frequency scales down. Effectively, it uses the CPU busy
time as proxy variable for the more nebulous "how critical is
performance right now" question.

This algorithm falls flat on its face in the light of workloads
where you're alternatingly disk and CPU bound, such as the ever
popular "git grep", but also things like startup of programs and
maildir using email clients... much to the chagarin of Andrew
Morton.

This patch changes the ondemand algorithm to count iowait time
as busy, not idle, time. As shown in the breakdown cases above,
iowait is performance critical often, and by counting iowait,
the proxy variable becomes a more accurate representation of the
"how critical is performance" question.

The problem and fix are both verified with the "perf timechar"
tool.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Jones <davej@redhat.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20100509082606.3d9f00d0@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
drivers/cpufreq/cpufreq_ondemand.c