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 | 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 | 73 | #ifdef CONFIG_POSIX_TIMERS |
| 66 | 74 | /** |
| 67 | 75 | * posix_cputimers - Container for posix CPU timer related data |
| 76 | + * @cputime_expires: Earliest-expiration cache | |
| 68 | 77 | * @cpu_timers: List heads to queue posix CPU timers |
| 69 | 78 | * |
| 70 | 79 | * Used in task_struct and signal_struct |
| 71 | 80 | */ |
| 72 | 81 | struct posix_cputimers { |
| 82 | + struct task_cputime cputime_expires; | |
| 73 | 83 | struct list_head cpu_timers[CPUCLOCK_MAX]; |
| 74 | 84 | }; |
| 75 | 85 | |
| 76 | 86 | static inline void posix_cputimers_init(struct posix_cputimers *pct) |
| 77 | 87 | { |
| 88 | + memset(&pct->cputime_expires, 0, sizeof(pct->cputime_expires)); | |
| 78 | 89 | INIT_LIST_HEAD(&pct->cpu_timers[0]); |
| 79 | 90 | INIT_LIST_HEAD(&pct->cpu_timers[1]); |
| 80 | 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 | 102 | /* Init task static initializer */ |
| 84 | 103 | #define INIT_CPU_TIMERLISTS(c) { \ |
| 85 | 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 | 113 | #else |
| 95 | 114 | struct posix_cputimers { }; |
| 96 | 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 | 119 | #endif |
| 98 | 120 | |
| 99 | 121 | #define REQUEUE_PENDING 1 |
| @@ -246,11 +246,6 @@ struct prev_cputime { · 245 unmodified lines | ||
| 246 | 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 | 249 | enum vtime_state { |
| 255 | 250 | /* Task is sleeping or running in a CPU with VTIME inactive: */ |
| 256 | 251 | VTIME_INACTIVE = 0, |
| @@ -862,9 +857,6 @@ struct task_struct { · 605 unmodified lines | ||
| 862 | 857 | unsigned long min_flt; |
| 863 | 858 | unsigned long maj_flt; |
| 864 | 859 | |
| 865 | −#ifdef CONFIG_POSIX_TIMERS | |
| 866 | − struct task_cputime cputime_expires; | |
| 867 | −#endif | |
| 868 | 860 | /* Empty if CONFIG_POSIX_CPUTIMERS=n */ |
| 869 | 861 | struct posix_cputimers posix_cputimers; |
| 870 | 862 | |
| @@ -149,9 +149,6 @@ struct signal_struct { · 148 unmodified lines | ||
| 149 | 149 | */ |
| 150 | 150 | struct thread_group_cputimer cputimer; |
| 151 | 151 | |
| 152 | − /* Earliest-expiration cache. */ | |
| 153 | − struct task_cputime cputime_expires; | |
| 154 | − | |
| 155 | 152 | #endif |
| 156 | 153 | /* Empty if CONFIG_POSIX_TIMERS=n */ |
| 157 | 154 | struct posix_cputimers posix_cputimers; |