Merge tag 'soc-defconfig-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
[linux-block.git] / include / linux / posix-timers.h
index 2c6e99ca48afcabb14c1800ff9ac4eb24c6edf7c..d607f51404fca063e4134bdba93bde6265be7d45 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <linux/spinlock.h>
 #include <linux/list.h>
+#include <linux/mutex.h>
 #include <linux/alarmtimer.h>
 #include <linux/timerqueue.h>
 
@@ -62,16 +63,18 @@ static inline int clockid_to_fd(const clockid_t clk)
  * cpu_timer - Posix CPU timer representation for k_itimer
  * @node:      timerqueue node to queue in the task/sig
  * @head:      timerqueue head on which this timer is queued
- * @task:      Pointer to target task
+ * @pid:       Pointer to target task PID
  * @elist:     List head for the expiry list
  * @firing:    Timer is currently firing
+ * @handling:  Pointer to the task which handles expiry
  */
 struct cpu_timer {
-       struct timerqueue_node  node;
-       struct timerqueue_head  *head;
-       struct pid              *pid;
-       struct list_head        elist;
-       int                     firing;
+       struct timerqueue_node          node;
+       struct timerqueue_head          *head;
+       struct pid                      *pid;
+       struct list_head                elist;
+       int                             firing;
+       struct task_struct __rcu        *handling;
 };
 
 static inline bool cpu_timer_enqueue(struct timerqueue_head *head,
@@ -135,10 +138,12 @@ struct posix_cputimers {
 /**
  * posix_cputimers_work - Container for task work based posix CPU timer expiry
  * @work:      The task work to be scheduled
+ * @mutex:     Mutex held around expiry in context of this task work
  * @scheduled:  @work has been scheduled already, no further processing
  */
 struct posix_cputimers_work {
        struct callback_head    work;
+       struct mutex            mutex;
        unsigned int            scheduled;
 };