The expiry cache belongs into the posix_cputimers container where the other cpu timers information is.
Showing the changes to include/linux (3 of 6 files). Show all
Unified · Split
| @@ -62,24 +62,43 @@ static inline int clockid_to_fd(const clockid_t clk) · 61 unmodified lines | |||
| 62 | return ~(clk >> 3); | 62 | return ~(clk >> 3); |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | /* | ||
| 66 | * Alternate field names for struct task_cputime when used on cache | ||
| 67 | * expirations. Will go away soon. | ||
| 68 | */ | ||
| 69 | #define virt_exp utime | ||
| 70 | #define prof_exp stime | ||
| 71 | #define sched_exp sum_exec_runtime | ||
| 72 | |||
| 65 | #ifdef CONFIG_POSIX_TIMERS | 73 | #ifdef CONFIG_POSIX_TIMERS |
| 66 | /** | 74 | /** |
| 67 | * posix_cputimers - Container for posix CPU timer related data | 75 | * posix_cputimers - Container for posix CPU timer related data |
| 76 | * @cputime_expires: Earliest-expiration cache | ||
| 68 | * @cpu_timers: List heads to queue posix CPU timers | 77 | * @cpu_timers: List heads to queue posix CPU timers |
| 69 | * | 78 | * |
| 70 | * Used in task_struct and signal_struct | 79 | * Used in task_struct and signal_struct |
| 71 | */ | 80 | */ |
| 72 | struct posix_cputimers { | 81 | struct posix_cputimers { |
| 82 | struct task_cputime cputime_expires; | ||
| 73 | struct list_head cpu_timers[CPUCLOCK_MAX]; | 83 | struct list_head cpu_timers[CPUCLOCK_MAX]; |
| 74 | }; | 84 | }; |
| 75 | 85 | ||
| 76 | static inline void posix_cputimers_init(struct posix_cputimers *pct) | 86 | static inline void posix_cputimers_init(struct posix_cputimers *pct) |
| 77 | { | 87 | { |
| 88 | memset(&pct->cputime_expires, 0, sizeof(pct->cputime_expires)); | ||
| 78 | INIT_LIST_HEAD(&pct->cpu_timers[0]); | 89 | INIT_LIST_HEAD(&pct->cpu_timers[0]); |
| 79 | INIT_LIST_HEAD(&pct->cpu_timers[1]); | 90 | INIT_LIST_HEAD(&pct->cpu_timers[1]); |
| 80 | INIT_LIST_HEAD(&pct->cpu_timers[2]); | 91 | INIT_LIST_HEAD(&pct->cpu_timers[2]); |
| 81 | } | 92 | } |
| 82 | 93 | ||
| 94 | void posix_cputimers_group_init(struct posix_cputimers *pct, u64 cpu_limit); | ||
| 95 | |||
| 96 | static inline void posix_cputimers_rt_watchdog(struct posix_cputimers *pct, | ||
| 97 | u64 runtime) | ||
| 98 | { | ||
| 99 | pct->cputime_expires.sched_exp = runtime; | ||
| 100 | } | ||
| 101 | |||
| 83 | /* Init task static initializer */ | 102 | /* Init task static initializer */ |
| 84 | #define INIT_CPU_TIMERLISTS(c) { \ | 103 | #define INIT_CPU_TIMERLISTS(c) { \ |
| 85 | LIST_HEAD_INIT(c.cpu_timers[0]), \ | 104 | LIST_HEAD_INIT(c.cpu_timers[0]), \ |
| @@ -94,6 +113,9 @@ static inline void posix_cputimers_init(struct posix_cputimers *pct) · 8 unmodified lines | |||
| 94 | #else | 113 | #else |
| 95 | struct posix_cputimers { }; | 114 | struct posix_cputimers { }; |
| 96 | #define INIT_CPU_TIMERS(s) | 115 | #define INIT_CPU_TIMERS(s) |
| 116 | static inline void posix_cputimers_init(struct posix_cputimers *pct) { } | ||
| 117 | static inline void posix_cputimers_group_init(struct posix_cputimers *pct, | ||
| 118 | u64 cpu_limit) { } | ||
| 97 | #endif | 119 | #endif |
| 98 | 120 | ||
| 99 | #define REQUEUE_PENDING 1 | 121 | #define REQUEUE_PENDING 1 |
| @@ -246,11 +246,6 @@ struct prev_cputime { · 245 unmodified lines | |||
| 246 | #endif | 246 | #endif |
| 247 | }; | 247 | }; |
| 248 | 248 | ||
| 249 | /* Alternate field names when used on cache expirations: */ | ||
| 250 | #define virt_exp utime | ||
| 251 | #define prof_exp stime | ||
| 252 | #define sched_exp sum_exec_runtime | ||
| 253 | |||
| 254 | enum vtime_state { | 249 | enum vtime_state { |
| 255 | /* Task is sleeping or running in a CPU with VTIME inactive: */ | 250 | /* Task is sleeping or running in a CPU with VTIME inactive: */ |
| 256 | VTIME_INACTIVE = 0, | 251 | VTIME_INACTIVE = 0, |
| @@ -862,9 +857,6 @@ struct task_struct { · 605 unmodified lines | |||
| 862 | unsigned long min_flt; | 857 | unsigned long min_flt; |
| 863 | unsigned long maj_flt; | 858 | unsigned long maj_flt; |
| 864 | 859 | ||
| 865 | #ifdef CONFIG_POSIX_TIMERS | ||
| 866 | struct task_cputime cputime_expires; | ||
| 867 | #endif | ||
| 868 | /* Empty if CONFIG_POSIX_CPUTIMERS=n */ | 860 | /* Empty if CONFIG_POSIX_CPUTIMERS=n */ |
| 869 | struct posix_cputimers posix_cputimers; | 861 | struct posix_cputimers posix_cputimers; |
| 870 | 862 | ||
| @@ -149,9 +149,6 @@ struct signal_struct { · 148 unmodified lines | |||
| 149 | */ | 149 | */ |
| 150 | struct thread_group_cputimer cputimer; | 150 | struct thread_group_cputimer cputimer; |
| 151 | 151 | ||
| 152 | /* Earliest-expiration cache. */ | ||
| 153 | struct task_cputime cputime_expires; | ||
| 154 | |||
| 155 | #endif | 152 | #endif |
| 156 | /* Empty if CONFIG_POSIX_TIMERS=n */ | 153 | /* Empty if CONFIG_POSIX_TIMERS=n */ |
| 157 | struct posix_cputimers posix_cputimers; | 154 | struct posix_cputimers posix_cputimers; |