Lines Matching refs:task

9  * task_work_add - ask the @task to execute @work->func()
10 * @task: the task which should run the callback
12 * @notify: how to notify the targeted task
14 * Queue @work for task_work_run() below and notify the @task if @notify
18 * task and run the task_work, regardless of whether the task is currently
21 * reschedule IPI to force the targeted task to reschedule and run task_work.
23 * task_work be run as soon as possible, just whenever the task enters the
25 * @TWA_RESUME work is run only when the task exits the kernel and returns to
28 * Fails if the @task is exiting/exited and thus it can't process this @work.
29 * Otherwise @work->func() will be called when the @task goes through one of
32 * If the targeted task is exiting, then an error is returned and the work item
42 int task_work_add(struct task_struct *task, struct callback_head *work,
50 head = READ_ONCE(task->task_works);
55 } while (!try_cmpxchg(&task->task_works, &head, work));
61 set_notify_resume(task);
64 set_notify_signal(task);
67 __set_notify_signal(task);
79 * @task: the task which should execute the work
87 task_work_cancel_match(struct task_struct *task,
91 struct callback_head **pprev = &task->task_works;
95 if (likely(!task_work_pending(task)))
103 raw_spin_lock_irqsave(&task->pi_lock, flags);
112 raw_spin_unlock_irqrestore(&task->pi_lock, flags);
124 * @task: the task which should execute the work
134 task_work_cancel(struct task_struct *task, task_work_func_t func)
136 return task_work_cancel_match(task, task_work_func_match, func);
143 * Called before the task returns to the user-mode or stops, or when
149 struct task_struct *task = current;
157 work = READ_ONCE(task->task_works);
161 if (task->flags & PF_EXITING)
166 } while (!try_cmpxchg(&task->task_works, &work, head));
175 raw_spin_lock_irq(&task->pi_lock);
176 raw_spin_unlock_irq(&task->pi_lock);