diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2012-11-13 18:24:25 -0500 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2012-11-19 10:41:32 -0500 |
commit | e3942ba04052364d3c6454103362cafd87456010 (patch) | |
tree | 31e5cd4013fd140cb3e50ad6147382798bc88631 /kernel/sched | |
parent | bcebdf846522056a84ba0b0cba5f5413868c9394 (diff) |
vtime: Consolidate a bit the ctx switch code
On ia64 and powerpc, vtime context switch only consists
in flushing system and user pending time, plus a few
arch housekeeping.
Consolidate that into a generic implementation. s390 is
a special case because pending user and system time accounting
there is hard to dissociate. So it's keeping its own implementation.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.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>
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/cputime.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index c0aa1ba752ea..2e8d34aac97e 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c | |||
@@ -443,6 +443,19 @@ void vtime_account_system_irqsafe(struct task_struct *tsk) | |||
443 | } | 443 | } |
444 | EXPORT_SYMBOL_GPL(vtime_account_system_irqsafe); | 444 | EXPORT_SYMBOL_GPL(vtime_account_system_irqsafe); |
445 | 445 | ||
446 | #ifndef __ARCH_HAS_VTIME_TASK_SWITCH | ||
447 | void vtime_task_switch(struct task_struct *prev) | ||
448 | { | ||
449 | if (is_idle_task(prev)) | ||
450 | vtime_account_idle(prev); | ||
451 | else | ||
452 | vtime_account_system(prev); | ||
453 | |||
454 | vtime_account_user(prev); | ||
455 | arch_vtime_task_switch(prev); | ||
456 | } | ||
457 | #endif | ||
458 | |||
446 | /* | 459 | /* |
447 | * Archs that account the whole time spent in the idle task | 460 | * Archs that account the whole time spent in the idle task |
448 | * (outside irq) as idle time can rely on this and just implement | 461 | * (outside irq) as idle time can rely on this and just implement |