summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2017-01-31 04:09:21 +0100
committerIngo Molnar <mingo@kernel.org>2017-02-01 09:13:48 +0100
commit16a6d9be90373fb0b521850cd0185a4d460dd152 (patch)
tree0f61f55bc77cfa7edada0f3ad538ddafb5757c4d /kernel
parent564b733c899f4e12a64946658960fce80cad0b05 (diff)
downloadlinux-stable-16a6d9be90373fb0b521850cd0185a4d460dd152.tar.gz
linux-stable-16a6d9be90373fb0b521850cd0185a4d460dd152.tar.bz2
linux-stable-16a6d9be90373fb0b521850cd0185a4d460dd152.zip
sched/cputime: Convert guest time accounting to nsecs (u64)
cputime_t is being obsolete and replaced by nsecs units in order to make internal timestamps less opaque and more granular. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rik van Riel <riel@redhat.com> Cc: Stanislaw Gruszka <sgruszka@redhat.com> Cc: Wanpeng Li <wanpeng.li@hotmail.com> Link: http://lkml.kernel.org/r/1485832191-26889-6-git-send-email-fweisbec@gmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/cputime.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
index 61e270926e94..8bcd98e2b821 100644
--- a/kernel/sched/cputime.c
+++ b/kernel/sched/cputime.c
@@ -158,7 +158,7 @@ void account_guest_time(struct task_struct *p, cputime_t cputime)
/* Add guest time to process. */
p->utime += cputime;
account_group_user_time(p, cputime);
- p->gtime += cputime;
+ p->gtime += cputime_to_nsecs(cputime);
/* Add guest time to cpustat. */
if (task_nice(p) > 0) {
@@ -824,10 +824,10 @@ void vtime_init_idle(struct task_struct *t, int cpu)
local_irq_restore(flags);
}
-cputime_t task_gtime(struct task_struct *t)
+u64 task_gtime(struct task_struct *t)
{
unsigned int seq;
- cputime_t gtime;
+ u64 gtime;
if (!vtime_accounting_enabled())
return t->gtime;
@@ -837,7 +837,7 @@ cputime_t task_gtime(struct task_struct *t)
gtime = t->gtime;
if (t->vtime_snap_whence == VTIME_SYS && t->flags & PF_VCPU)
- gtime += vtime_delta(t);
+ gtime += cputime_to_nsecs(vtime_delta(t));
} while (read_seqcount_retry(&t->vtime_seqcount, seq));