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>
这个提交包含在:
@@ -100,18 +100,11 @@ void vtime_account_user(struct task_struct *tsk)
|
||||
* accumulated times to the current process, and to prepare accounting on
|
||||
* the next process.
|
||||
*/
|
||||
void vtime_task_switch(struct task_struct *prev)
|
||||
void arch_vtime_task_switch(struct task_struct *prev)
|
||||
{
|
||||
struct thread_info *pi = task_thread_info(prev);
|
||||
struct thread_info *ni = task_thread_info(current);
|
||||
|
||||
if (idle_task(smp_processor_id()) != prev)
|
||||
vtime_account_system(prev);
|
||||
else
|
||||
vtime_account_idle(prev);
|
||||
|
||||
vtime_account_user(prev);
|
||||
|
||||
pi->ac_stamp = ni->ac_stamp;
|
||||
ni->ac_stime = ni->ac_utime = 0;
|
||||
}
|
||||
|
在新工单中引用
屏蔽一个用户