diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2017-01-21 00:09:08 -0500 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2017-01-27 13:05:26 -0800 |
commit | b18b6a9cef7f30e9a8b7738d5fc8d568cf660855 (patch) | |
tree | 51be9f1d6b36120182dc4e0906460ddc1e011d65 /include/linux/sched.h | |
parent | 9f8197980d87a28ec3d0b3b986f770e7e7878485 (diff) | |
download | lwn-b18b6a9cef7f30e9a8b7738d5fc8d568cf660855.tar.gz lwn-b18b6a9cef7f30e9a8b7738d5fc8d568cf660855.zip |
timers: Omit POSIX timer stuff from task_struct when disabled
When CONFIG_POSIX_TIMERS is disabled, it is preferable to remove related
structures from struct task_struct and struct signal_struct as they
won't contain anything useful and shouldn't be relied upon by mistake.
Code still referencing those structures is also disabled here.
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 4d1905245c7a..e8f6af59726d 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -734,13 +734,14 @@ struct signal_struct { unsigned int is_child_subreaper:1; unsigned int has_child_subreaper:1; +#ifdef CONFIG_POSIX_TIMERS + /* POSIX.1b Interval Timers */ int posix_timer_id; struct list_head posix_timers; /* ITIMER_REAL timer for the process */ struct hrtimer real_timer; - struct pid *leader_pid; ktime_t it_real_incr; /* @@ -759,12 +760,16 @@ struct signal_struct { /* Earliest-expiration cache. */ struct task_cputime cputime_expires; + struct list_head cpu_timers[3]; + +#endif + + struct pid *leader_pid; + #ifdef CONFIG_NO_HZ_FULL atomic_t tick_dep_mask; #endif - struct list_head cpu_timers[3]; - struct pid *tty_old_pgrp; /* boolean value for session group leader */ @@ -1681,8 +1686,10 @@ struct task_struct { /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ unsigned long min_flt, maj_flt; +#ifdef CONFIG_POSIX_TIMERS struct task_cputime cputime_expires; struct list_head cpu_timers[3]; +#endif /* process credentials */ const struct cred __rcu *ptracer_cred; /* Tracer's credentials at attach */ |