diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2014-07-17 01:04:34 +0400 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2014-07-23 21:18:05 +0400 |
commit | ccbf62d8a284cf181ac28c8e8407dd077d90dd4b (patch) | |
tree | 7e1a4fffdc9a8f46e4bd22ad6070ad4fa768f1ed /kernel/acct.c | |
parent | 57e0be041d9e21a7397eed3b67a7936ac4ac83c0 (diff) | |
download | linux-ccbf62d8a284cf181ac28c8e8407dd077d90dd4b.tar.xz |
sched: Make task->start_time nanoseconds based
Simplify the timespec to nsec/usec conversions.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel/acct.c')
-rw-r--r-- | kernel/acct.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/kernel/acct.c b/kernel/acct.c index 1be013c6053e..a1844f14c6d6 100644 --- a/kernel/acct.c +++ b/kernel/acct.c @@ -458,9 +458,7 @@ static void do_acct_process(struct bsd_acct_struct *acct, acct_t ac; mm_segment_t fs; unsigned long flim; - u64 elapsed; - u64 run_time; - struct timespec uptime; + u64 elapsed, run_time; struct tty_struct *tty; const struct cred *orig_cred; @@ -484,10 +482,8 @@ static void do_acct_process(struct bsd_acct_struct *acct, strlcpy(ac.ac_comm, current->comm, sizeof(ac.ac_comm)); /* calculate run_time in nsec*/ - ktime_get_ts(&uptime); - run_time = (u64)uptime.tv_sec*NSEC_PER_SEC + uptime.tv_nsec; - run_time -= (u64)current->group_leader->start_time.tv_sec * NSEC_PER_SEC - + current->group_leader->start_time.tv_nsec; + run_time = ktime_get_ns(); + run_time -= current->group_leader->start_time; /* convert nsec -> AHZ */ elapsed = nsec_to_AHZ(run_time); #if ACCT_VERSION==3 |