sched: Update the idle statistics in get_cpu_idle_time_us()
authorArjan van de Ven <arjan@linux.intel.com>
Sun, 9 May 2010 15:23:23 +0000 (08:23 -0700)
committerIngo Molnar <mingo@elte.hu>
Sun, 9 May 2010 17:35:26 +0000 (19:35 +0200)
commit8c7b09f43f4bf570654bcc458ce96819a932303c
tree33eb6f860fa9a31ea63b67247890a6762439fde2
parent595aac488b546c7185be7e29c8ae165a588b2a9f
sched: Update the idle statistics in get_cpu_idle_time_us()

Right now, get_cpu_idle_time_us() only reports the idle
statistics upto the point the CPU entered last idle; not what is
valid right now.

This patch adds an update of the idle statistics to
get_cpu_idle_time_us(), so that calling this function always
returns statistics that are accurate at the point of the call.

This includes resetting the start of the idle time for
accounting purposes to avoid double accounting.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Rik van Riel <riel@redhat.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: davej@redhat.com
LKML-Reference: <20100509082323.2d2f1945@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/time/tick-sched.c