Lines Matching refs:work

19  * task_work_add - ask the @task to execute @work->func()
21 * @work: the callback to run
24 * Queue @work for task_work_run() below and notify the @task if @notify
35 * @TWA_RESUME work is run only when the task exits the kernel and returns to
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,
65 kasan_record_aux_stack(work);
72 work->next = head;
73 } while (!try_cmpxchg(&task->task_works, &head, work));
101 * task_work_cancel_match - cancel a pending work added by task_work_add()
102 * @task: the task which should execute the work
107 * The found work or NULL if not found.
115 struct callback_head *work;
123 * new entry before this work, we will find it again. Or
127 work = READ_ONCE(*pprev);
128 while (work) {
129 if (!match(work, data)) {
130 pprev = &work->next;
131 work = READ_ONCE(*pprev);
132 } else if (try_cmpxchg(pprev, &work, work->next))
137 return work;
146 * task_work_cancel_func - cancel a pending work matching a function added by task_work_add()
147 * @task: the task which should execute the func's work
148 * @func: identifies the func to match with a work to remove
150 * Find the last queued pending work with ->func == @func and remove
154 * The found work or NULL if not found.
168 * task_work_cancel - cancel a pending work added by task_work_add()
169 * @task: the task which should execute the work
192 * new work after task_work_run() returns.
197 struct callback_head *work, *head, *next;
201 * work->func() can do task_work_add(), do not set
204 work = READ_ONCE(task->task_works);
207 if (!work) {
213 } while (!try_cmpxchg(&task->task_works, &work, head));
215 if (!work)
219 * the first entry == work, cmpxchg(task_works) must fail.
226 next = work->next;
227 work->func(work);
228 work = next;
230 } while (work);