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
6262 return ~(clk >> 3);
6363 }
6464
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+
6573 #ifdef CONFIG_POSIX_TIMERS
6674 /**
6775 * posix_cputimers - Container for posix CPU timer related data
76+ * @cputime_expires: Earliest-expiration cache
6877 * @cpu_timers: List heads to queue posix CPU timers
6978 *
7079 * Used in task_struct and signal_struct
7180 */
7281 struct posix_cputimers {
82+ struct task_cputime cputime_expires;
7383 struct list_head cpu_timers[CPUCLOCK_MAX];
7484 };
7585
7686 static inline void posix_cputimers_init(struct posix_cputimers *pct)
7787 {
88+ memset(&pct->cputime_expires, 0, sizeof(pct->cputime_expires));
7889 INIT_LIST_HEAD(&pct->cpu_timers[0]);
7990 INIT_LIST_HEAD(&pct->cpu_timers[1]);
8091 INIT_LIST_HEAD(&pct->cpu_timers[2]);
8192 }
8293
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+
83102 /* Init task static initializer */
84103 #define INIT_CPU_TIMERLISTS(c) { \
85104 LIST_HEAD_INIT(c.cpu_timers[0]), \
@@ -94,6 +113,9 @@ static inline void posix_cputimers_init(struct posix_cputimers *pct) · 8 unmodified lines
94113 #else
95114 struct posix_cputimers { };
96115 #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) { }
97119 #endif
98120
99121 #define REQUEUE_PENDING 1
include/linux/sched.h+0−8
@@ -246,11 +246,6 @@ struct prev_cputime { · 245 unmodified lines
246246 #endif
247247 };
248248
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−
254249 enum vtime_state {
255250 /* Task is sleeping or running in a CPU with VTIME inactive: */
256251 VTIME_INACTIVE = 0,
@@ -862,9 +857,6 @@ struct task_struct { · 605 unmodified lines
862857 unsigned long min_flt;
863858 unsigned long maj_flt;
864859
865−#ifdef CONFIG_POSIX_TIMERS
866− struct task_cputime cputime_expires;
867−#endif
868860 /* Empty if CONFIG_POSIX_CPUTIMERS=n */
869861 struct posix_cputimers posix_cputimers;
870862
include/linux/sched/signal.h+0−3
@@ -149,9 +149,6 @@ struct signal_struct { · 148 unmodified lines
149149 */
150150 struct thread_group_cputimer cputimer;
151151
152− /* Earliest-expiration cache. */
153− struct task_cputime cputime_expires;
154−
155152 #endif
156153 /* Empty if CONFIG_POSIX_TIMERS=n */
157154 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