aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-07-16 17:04:32 -0400
committerJohn Stultz <john.stultz@linaro.org>2014-07-23 13:18:05 -0400
commit57e0be041d9e21a7397eed3b67a7936ac4ac83c0 (patch)
tree789396df941faa3b43bd61b27b675157a423070b
parentd560fed6abe0f9975b509e4fb824e08ac19adc93 (diff)
sched: Make task->real_start_time nanoseconds based
Simplify the only user of this data by removing the timespec conversion. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
-rw-r--r--fs/proc/array.c7
-rw-r--r--include/linux/sched.h2
-rw-r--r--kernel/fork.c3
3 files changed, 3 insertions, 9 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 64db2bceac59..d7f9199217bb 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -473,13 +473,8 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
473 priority = task_prio(task); 473 priority = task_prio(task);
474 nice = task_nice(task); 474 nice = task_nice(task);
475 475
476 /* Temporary variable needed for gcc-2.96 */
477 /* convert timespec -> nsec*/
478 start_time =
479 (unsigned long long)task->real_start_time.tv_sec * NSEC_PER_SEC
480 + task->real_start_time.tv_nsec;
481 /* convert nsec -> ticks */ 476 /* convert nsec -> ticks */
482 start_time = nsec_to_clock_t(start_time); 477 start_time = nsec_to_clock_t(task->real_start_time);
483 478
484 seq_printf(m, "%d (%s) %c", pid_nr_ns(pid, ns), tcomm, state); 479 seq_printf(m, "%d (%s) %c", pid_nr_ns(pid, ns), tcomm, state);
485 seq_put_decimal_ll(m, ' ', ppid); 480 seq_put_decimal_ll(m, ' ', ppid);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 306f4f0c987a..67678fa76f99 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1368,7 +1368,7 @@ struct task_struct {
1368#endif 1368#endif
1369 unsigned long nvcsw, nivcsw; /* context switch counts */ 1369 unsigned long nvcsw, nivcsw; /* context switch counts */
1370 struct timespec start_time; /* monotonic time */ 1370 struct timespec start_time; /* monotonic time */
1371 struct timespec real_start_time; /* boot based time */ 1371 u64 real_start_time; /* boot based time in nsec */
1372/* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ 1372/* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */
1373 unsigned long min_flt, maj_flt; 1373 unsigned long min_flt, maj_flt;
1374 1374
diff --git a/kernel/fork.c b/kernel/fork.c
index 8f541930ce26..a7ab82db2f60 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1263,8 +1263,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1263 posix_cpu_timers_init(p); 1263 posix_cpu_timers_init(p);
1264 1264
1265 ktime_get_ts(&p->start_time); 1265 ktime_get_ts(&p->start_time);
1266 p->real_start_time = p->start_time; 1266 p->real_start_time = ktime_get_boot_ns();
1267 monotonic_to_bootbased(&p->real_start_time);
1268 p->io_context = NULL; 1267 p->io_context = NULL;
1269 p->audit_context = NULL; 1268 p->audit_context = NULL;
1270 if (clone_flags & CLONE_THREAD) 1269 if (clone_flags & CLONE_THREAD)