sched/cputime: Guarantee stime + utime == rtime
[cascardo/linux.git] / include / linux / init_task.h
index e8493fe..d0b380e 100644 (file)
@@ -32,6 +32,14 @@ extern struct fs_struct init_fs;
 #define INIT_CPUSET_SEQ(tsk)
 #endif
 
+#ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
+#define INIT_PREV_CPUTIME(x)   .prev_cputime = {                       \
+       .lock = __RAW_SPIN_LOCK_UNLOCKED(x.prev_cputime.lock),          \
+},
+#else
+#define INIT_PREV_CPUTIME(x)
+#endif
+
 #define INIT_SIGNALS(sig) {                                            \
        .nr_threads     = 1,                                            \
        .thread_head    = LIST_HEAD_INIT(init_task.thread_node),        \
@@ -46,6 +54,7 @@ extern struct fs_struct init_fs;
                .cputime_atomic = INIT_CPUTIME_ATOMIC,                  \
                .running        = 0,                                    \
        },                                                              \
+       INIT_PREV_CPUTIME(sig)                                          \
        .cred_guard_mutex =                                             \
                 __MUTEX_INITIALIZER(sig.cred_guard_mutex),             \
 }
@@ -246,6 +255,7 @@ extern struct task_group root_task_group;
        INIT_TASK_RCU_TASKS(tsk)                                        \
        INIT_CPUSET_SEQ(tsk)                                            \
        INIT_RT_MUTEXES(tsk)                                            \
+       INIT_PREV_CPUTIME(tsk)                                          \
        INIT_VTIME(tsk)                                                 \
        INIT_NUMA_BALANCING(tsk)                                        \
        INIT_KASAN(tsk)                                                 \