sched: Make task->real_start_time nanoseconds based
authorThomas Gleixner <tglx@linutronix.de>
Wed, 16 Jul 2014 21:04:32 +0000 (21:04 +0000)
committerJohn Stultz <john.stultz@linaro.org>
Wed, 23 Jul 2014 17:18:05 +0000 (10:18 -0700)
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>
fs/proc/array.c
include/linux/sched.h
kernel/fork.c

index 64db2bceac59e7634976235bcddeada98e592b1c..d7f9199217bb860205a03e23291481224de6bb29 100644 (file)
@@ -473,13 +473,8 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
        priority = task_prio(task);
        nice = task_nice(task);
 
-       /* Temporary variable needed for gcc-2.96 */
-       /* convert timespec -> nsec*/
-       start_time =
-               (unsigned long long)task->real_start_time.tv_sec * NSEC_PER_SEC
-                               + task->real_start_time.tv_nsec;
        /* convert nsec -> ticks */
-       start_time = nsec_to_clock_t(start_time);
+       start_time = nsec_to_clock_t(task->real_start_time);
 
        seq_printf(m, "%d (%s) %c", pid_nr_ns(pid, ns), tcomm, state);
        seq_put_decimal_ll(m, ' ', ppid);
index 306f4f0c987a006f43f520413f7de3a780f98a23..67678fa76f995f9819e0ae1223daf0cebf50b681 100644 (file)
@@ -1368,7 +1368,7 @@ struct task_struct {
 #endif
        unsigned long nvcsw, nivcsw; /* context switch counts */
        struct timespec start_time;             /* monotonic time */
-       struct timespec real_start_time;        /* boot based time */
+       u64 real_start_time;    /* boot based time in nsec */
 /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */
        unsigned long min_flt, maj_flt;
 
index 8f541930ce26c47160bd24ef41208b441beb6d0a..a7ab82db2f601ab0c34b06a579f60662c7ce4211 100644 (file)
@@ -1263,8 +1263,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
        posix_cpu_timers_init(p);
 
        ktime_get_ts(&p->start_time);
-       p->real_start_time = p->start_time;
-       monotonic_to_bootbased(&p->real_start_time);
+       p->real_start_time = ktime_get_boot_ns();
        p->io_context = NULL;
        p->audit_context = NULL;
        if (clone_flags & CLONE_THREAD)