diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/acct.c | 2 | ||||
-rw-r--r-- | kernel/hrtimer.c | 2 | ||||
-rw-r--r-- | kernel/time.c | 16 | ||||
-rw-r--r-- | kernel/time/timekeeping.c | 16 | ||||
-rw-r--r-- | kernel/tsacct.c | 2 |
5 files changed, 19 insertions, 19 deletions
diff --git a/kernel/acct.c b/kernel/acct.c index 70d0d88e5554..24f0f8b2ba72 100644 --- a/kernel/acct.c +++ b/kernel/acct.c | |||
@@ -468,7 +468,7 @@ static void do_acct_process(struct file *file) | |||
468 | } | 468 | } |
469 | #endif | 469 | #endif |
470 | do_div(elapsed, AHZ); | 470 | do_div(elapsed, AHZ); |
471 | ac.ac_btime = xtime.tv_sec - elapsed; | 471 | ac.ac_btime = get_seconds() - elapsed; |
472 | /* we really need to bite the bullet and change layout */ | 472 | /* we really need to bite the bullet and change layout */ |
473 | ac.ac_uid = current->uid; | 473 | ac.ac_uid = current->uid; |
474 | ac.ac_gid = current->gid; | 474 | ac.ac_gid = current->gid; |
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index eb1ddebd2c04..a7bb05e6cb63 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
@@ -144,7 +144,7 @@ static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base) | |||
144 | #ifdef CONFIG_NO_HZ | 144 | #ifdef CONFIG_NO_HZ |
145 | getnstimeofday(&xts); | 145 | getnstimeofday(&xts); |
146 | #else | 146 | #else |
147 | xts = xtime; | 147 | xts = current_kernel_time(); |
148 | #endif | 148 | #endif |
149 | tom = wall_to_monotonic; | 149 | tom = wall_to_monotonic; |
150 | } while (read_seqretry(&xtime_lock, seq)); | 150 | } while (read_seqretry(&xtime_lock, seq)); |
diff --git a/kernel/time.c b/kernel/time.c index 5b81da08bbdb..2289a8d68314 100644 --- a/kernel/time.c +++ b/kernel/time.c | |||
@@ -215,22 +215,6 @@ asmlinkage long sys_adjtimex(struct timex __user *txc_p) | |||
215 | return copy_to_user(txc_p, &txc, sizeof(struct timex)) ? -EFAULT : ret; | 215 | return copy_to_user(txc_p, &txc, sizeof(struct timex)) ? -EFAULT : ret; |
216 | } | 216 | } |
217 | 217 | ||
218 | inline struct timespec current_kernel_time(void) | ||
219 | { | ||
220 | struct timespec now; | ||
221 | unsigned long seq; | ||
222 | |||
223 | do { | ||
224 | seq = read_seqbegin(&xtime_lock); | ||
225 | |||
226 | now = xtime; | ||
227 | } while (read_seqretry(&xtime_lock, seq)); | ||
228 | |||
229 | return now; | ||
230 | } | ||
231 | |||
232 | EXPORT_SYMBOL(current_kernel_time); | ||
233 | |||
234 | /** | 218 | /** |
235 | * current_fs_time - Return FS time | 219 | * current_fs_time - Return FS time |
236 | * @sb: Superblock. | 220 | * @sb: Superblock. |
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 88c81026e003..07a3f1420c27 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -509,3 +509,19 @@ void monotonic_to_bootbased(struct timespec *ts) | |||
509 | { | 509 | { |
510 | ts->tv_sec += total_sleep_time; | 510 | ts->tv_sec += total_sleep_time; |
511 | } | 511 | } |
512 | |||
513 | struct timespec current_kernel_time(void) | ||
514 | { | ||
515 | struct timespec now; | ||
516 | unsigned long seq; | ||
517 | |||
518 | do { | ||
519 | seq = read_seqbegin(&xtime_lock); | ||
520 | |||
521 | now = xtime; | ||
522 | } while (read_seqretry(&xtime_lock, seq)); | ||
523 | |||
524 | return now; | ||
525 | } | ||
526 | |||
527 | EXPORT_SYMBOL(current_kernel_time); | ||
diff --git a/kernel/tsacct.c b/kernel/tsacct.c index 658f638c402c..c122131a122f 100644 --- a/kernel/tsacct.c +++ b/kernel/tsacct.c | |||
@@ -39,7 +39,7 @@ void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk) | |||
39 | ac_etime = timespec_to_ns(&ts); | 39 | ac_etime = timespec_to_ns(&ts); |
40 | do_div(ac_etime, NSEC_PER_USEC); | 40 | do_div(ac_etime, NSEC_PER_USEC); |
41 | stats->ac_etime = ac_etime; | 41 | stats->ac_etime = ac_etime; |
42 | stats->ac_btime = xtime.tv_sec - ts.tv_sec; | 42 | stats->ac_btime = get_seconds() - ts.tv_sec; |
43 | if (thread_group_leader(tsk)) { | 43 | if (thread_group_leader(tsk)) { |
44 | stats->ac_exitcode = tsk->exit_code; | 44 | stats->ac_exitcode = tsk->exit_code; |
45 | if (tsk->flags & PF_FORKNOEXEC) | 45 | if (tsk->flags & PF_FORKNOEXEC) |