Lines Matching full:task
19 * task_work_add - ask the @task to execute @work->func()
20 * @task: the task which should run the callback
22 * @notify: how to notify the targeted task
24 * Queue @work for task_work_run() below and notify the @task if @notify
28 * task and run the task_work, regardless of whether the task is currently
31 * reschedule IPI to force the targeted task to reschedule and run task_work.
33 * task_work be run as soon as possible, just whenever the task enters the
35 * @TWA_RESUME work is run only when the task exits the kernel and returns to
38 * current @task and if the current context is NMI.
40 * Fails if the @task is exiting/exited and thus it can't process this @work.
41 * Otherwise @work->func() will be called when the @task goes through one of
44 * If the targeted task is exiting, then an error is returned and the work item
54 int task_work_add(struct task_struct *task, struct callback_head *work, in task_work_add() argument
60 if (WARN_ON_ONCE(task != current)) in task_work_add()
68 head = READ_ONCE(task->task_works); in task_work_add()
73 } while (!try_cmpxchg(&task->task_works, &head, work)); in task_work_add()
79 set_notify_resume(task); in task_work_add()
82 set_notify_signal(task); in task_work_add()
85 __set_notify_signal(task); in task_work_add()
102 * @task: the task which should execute the work
110 task_work_cancel_match(struct task_struct *task, in task_work_cancel_match() argument
114 struct callback_head **pprev = &task->task_works; in task_work_cancel_match()
118 if (likely(!task_work_pending(task))) in task_work_cancel_match()
126 raw_spin_lock_irqsave(&task->pi_lock, flags); in task_work_cancel_match()
135 raw_spin_unlock_irqrestore(&task->pi_lock, flags); in task_work_cancel_match()
147 * @task: the task which should execute the func's work
157 task_work_cancel_func(struct task_struct *task, task_work_func_t func) in task_work_cancel_func() argument
159 return task_work_cancel_match(task, task_work_func_match, func); in task_work_cancel_func()
169 * @task: the task which should execute the work
172 * Remove a callback from a task's queue if queued.
177 bool task_work_cancel(struct task_struct *task, struct callback_head *cb) in task_work_cancel() argument
181 ret = task_work_cancel_match(task, task_work_match, cb); in task_work_cancel()
190 * Called before the task returns to the user-mode or stops, or when
196 struct task_struct *task = current; in task_work_run() local
204 work = READ_ONCE(task->task_works); in task_work_run()
208 if (task->flags & PF_EXITING) in task_work_run()
213 } while (!try_cmpxchg(&task->task_works, &work, head)); in task_work_run()
222 raw_spin_lock_irq(&task->pi_lock); in task_work_run()
223 raw_spin_unlock_irq(&task->pi_lock); in task_work_run()