sched/cputime: Push time to account_system_time() in nsecs
This is one more step toward converting cputime accounting to pure nsecs. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rik van Riel <riel@redhat.com> Cc: Stanislaw Gruszka <sgruszka@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tony Luck <tony.luck@intel.com> Cc: Wanpeng Li <wanpeng.li@hotmail.com> Link: http://lkml.kernel.org/r/1485832191-26889-25-git-send-email-fweisbec@gmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:

committed by
Ingo Molnar

parent
18b43a9bd7
commit
fb8b049c98
@@ -57,6 +57,7 @@
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/suspend.h>
|
||||
#include <linux/rtc.h>
|
||||
#include <linux/cputime.h>
|
||||
#include <asm/trace.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
@@ -72,7 +73,6 @@
|
||||
#include <asm/smp.h>
|
||||
#include <asm/vdso_datapage.h>
|
||||
#include <asm/firmware.h>
|
||||
#include <asm/cputime.h>
|
||||
#include <asm/asm-prototypes.h>
|
||||
|
||||
/* powerpc clocksource/clockevent code */
|
||||
@@ -399,7 +399,7 @@ void vtime_flush(struct task_struct *tsk)
|
||||
tsk->utimescaled += cputime_to_nsecs(acct->utime_scaled);
|
||||
|
||||
if (acct->gtime)
|
||||
account_guest_time(tsk, acct->gtime);
|
||||
account_guest_time(tsk, cputime_to_nsecs(acct->gtime));
|
||||
|
||||
if (acct->steal_time)
|
||||
account_steal_time(cputime_to_nsecs(acct->steal_time));
|
||||
@@ -408,16 +408,17 @@ void vtime_flush(struct task_struct *tsk)
|
||||
account_idle_time(cputime_to_nsecs(acct->idle_time));
|
||||
|
||||
if (acct->stime)
|
||||
account_system_index_time(tsk, acct->stime, CPUTIME_SYSTEM);
|
||||
|
||||
account_system_index_time(tsk, cputime_to_nsecs(acct->stime),
|
||||
CPUTIME_SYSTEM);
|
||||
if (acct->stime_scaled)
|
||||
tsk->stimescaled += cputime_to_nsecs(acct->stime_scaled);
|
||||
|
||||
if (acct->hardirq_time)
|
||||
account_system_index_time(tsk, acct->hardirq_time, CPUTIME_IRQ);
|
||||
|
||||
account_system_index_time(tsk, cputime_to_nsecs(acct->hardirq_time),
|
||||
CPUTIME_IRQ);
|
||||
if (acct->softirq_time)
|
||||
account_system_index_time(tsk, acct->softirq_time, CPUTIME_SOFTIRQ);
|
||||
account_system_index_time(tsk, cputime_to_nsecs(acct->softirq_time),
|
||||
CPUTIME_SOFTIRQ);
|
||||
|
||||
acct->utime = 0;
|
||||
acct->utime_scaled = 0;
|
||||
|
Reference in New Issue
Block a user