summaryrefslogtreecommitdiffstats
path: root/kernel/acct.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-07-16 23:04:34 +0200
committerJohn Stultz <john.stultz@linaro.org>2014-07-23 19:18:05 +0200
commitccbf62d8a284cf181ac28c8e8407dd077d90dd4b (patch)
tree7e1a4fffdc9a8f46e4bd22ad6070ad4fa768f1ed /kernel/acct.c
parentsched: Make task->real_start_time nanoseconds based (diff)
downloadlinux-ccbf62d8a284cf181ac28c8e8407dd077d90dd4b.tar.xz
linux-ccbf62d8a284cf181ac28c8e8407dd077d90dd4b.zip
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.c10
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