hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/include/linux/posix-timers.h
....@@ -4,6 +4,7 @@
44
55 #include <linux/spinlock.h>
66 #include <linux/list.h>
7
+#include <linux/mutex.h>
78 #include <linux/alarmtimer.h>
89 #include <linux/timerqueue.h>
910 #include <linux/task_work.h>
....@@ -63,16 +64,18 @@
6364 * cpu_timer - Posix CPU timer representation for k_itimer
6465 * @node: timerqueue node to queue in the task/sig
6566 * @head: timerqueue head on which this timer is queued
66
- * @task: Pointer to target task
67
+ * @pid: Pointer to target task PID
6768 * @elist: List head for the expiry list
6869 * @firing: Timer is currently firing
70
+ * @handling: Pointer to the task which handles expiry
6971 */
7072 struct cpu_timer {
71
- struct timerqueue_node node;
72
- struct timerqueue_head *head;
73
- struct pid *pid;
74
- struct list_head elist;
75
- int firing;
73
+ struct timerqueue_node node;
74
+ struct timerqueue_head *head;
75
+ struct pid *pid;
76
+ struct list_head elist;
77
+ int firing;
78
+ struct task_struct __rcu *handling;
7679 };
7780
7881 static inline bool cpu_timer_enqueue(struct timerqueue_head *head,
....@@ -129,10 +132,12 @@
129132 /**
130133 * posix_cputimers_work - Container for task work based posix CPU timer expiry
131134 * @work: The task work to be scheduled
135
+ * @mutex: Mutex held around expiry in context of this task work
132136 * @scheduled: @work has been scheduled already, no further processing
133137 */
134138 struct posix_cputimers_work {
135139 struct callback_head work;
140
+ struct mutex mutex;
136141 unsigned int scheduled;
137142 };
138143