vtime: Consolidate system/idle context detection
authorFrederic Weisbecker <fweisbec@gmail.com>
Sat, 8 Sep 2012 14:14:02 +0000 (16:14 +0200)
committerFrederic Weisbecker <fweisbec@gmail.com>
Tue, 25 Sep 2012 13:42:37 +0000 (15:42 +0200)
commita7e1a9e3af71b45ecae2dae35851f238117b317d
tree8b1d15d63779ba13d7884288c96a3510b7fde4b6
parentbf9fae9f5e4ca8dce4708812f9ad6281e61df109
vtime: Consolidate system/idle context detection

Move the code that finds out to which context we account the
cputime into generic layer.

Archs that consider the whole time spent in the idle task as idle
time (ia64, powerpc) can rely on the generic vtime_account()
and implement vtime_account_system() and vtime_account_idle(),
letting the generic code to decide when to call which API.

Archs that have their own meaning of idle time, such as s390
that only considers the time spent in CPU low power mode as idle
time, can just override vtime_account().

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
arch/ia64/kernel/time.c
arch/powerpc/kernel/time.c
arch/s390/include/asm/cputime.h
include/linux/kernel_stat.h
kernel/sched/cputime.c