History

posix-cpu-timers: Move expiry cache into struct posix_cputimers

The expiry cache belongs into the posix_cputimers container where the other cpu timers information is.

Thomas Gleixner committed 7 years ago

Commit 3a245c01 parent 9eacb5c6 files · +56 −53Browse files

Showing the changes to include/linux (3 of 6 files). Show all

Unified · Split

3 files
  1. include/linux/posix-timers.h +22 −0
  2. include/linux/sched.h +0 −8
  3. include/linux/sched/signal.h +0 −3
include/linux/posix-timers.h+22−0
@@ -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_TIMERS73#ifdef CONFIG_POSIX_TIMERS
66/**74/**
67 * posix_cputimers - Container for posix CPU timer related data75 * posix_cputimers - Container for posix CPU timer related data
76 * @cputime_expires: Earliest-expiration cache
68 * @cpu_timers: List heads to queue posix CPU timers77 * @cpu_timers: List heads to queue posix CPU timers
69 *78 *
70 * Used in task_struct and signal_struct79 * Used in task_struct and signal_struct
71 */80 */
72struct posix_cputimers {81struct 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
76static inline void posix_cputimers_init(struct posix_cputimers *pct)86static 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
94void posix_cputimers_group_init(struct posix_cputimers *pct, u64 cpu_limit);
95
96static 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#else113#else
95struct posix_cputimers { };114struct posix_cputimers { };
96#define INIT_CPU_TIMERS(s)115#define INIT_CPU_TIMERS(s)
116static inline void posix_cputimers_init(struct posix_cputimers *pct) { }
117static inline void posix_cputimers_group_init(struct posix_cputimers *pct,
118 u64 cpu_limit) { }
97#endif119#endif
98 120
99#define REQUEUE_PENDING 1121#define REQUEUE_PENDING 1
include/linux/sched.h+0−8
@@ -246,11 +246,6 @@ struct prev_cputime { · 245 unmodified lines
246#endif246#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
254enum vtime_state {249enum 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
include/linux/sched/signal.h+0−3
@@ -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#endif152#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;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t