Lines Matching full:work
3 * workqueue.h --- work queue handling for Linux.
21 typedef void (*work_func_t)(struct work_struct *work);
25 * The first word is the work queue pointer and the flags rolled into
28 #define work_data_bits(work) ((unsigned long *)(&(work)->data)) argument
31 WORK_STRUCT_PENDING_BIT = 0, /* work item is pending execution */
32 WORK_STRUCT_INACTIVE_BIT= 1, /* work item is inactive */
34 WORK_STRUCT_LINKED_BIT = 3, /* next work is linked to this one */
74 * When a work item is off queue, its high bits point to the last
111 struct work_struct work; member
114 /* target workqueue and CPU ->timer uses to queue ->work */
120 struct work_struct work; member
123 /* target workqueue ->rcu uses to queue ->work */
153 static inline struct delayed_work *to_delayed_work(struct work_struct *work) in to_delayed_work() argument
155 return container_of(work, struct delayed_work, work); in to_delayed_work()
158 static inline struct rcu_work *to_rcu_work(struct work_struct *work) in to_rcu_work() argument
160 return container_of(work, struct rcu_work, work); in to_rcu_work()
164 struct work_struct work; member
187 .work = __WORK_INITIALIZER((n).work, (f)), \
202 extern void __init_work(struct work_struct *work, int onstack);
203 extern void destroy_work_on_stack(struct work_struct *work);
204 extern void destroy_delayed_work_on_stack(struct delayed_work *work);
205 static inline unsigned int work_static(struct work_struct *work) in work_static() argument
207 return *work_data_bits(work) & WORK_STRUCT_STATIC; in work_static()
210 static inline void __init_work(struct work_struct *work, int onstack) { } in __init_work() argument
211 static inline void destroy_work_on_stack(struct work_struct *work) { } in destroy_work_on_stack() argument
212 static inline void destroy_delayed_work_on_stack(struct delayed_work *work) { } in destroy_delayed_work_on_stack() argument
213 static inline unsigned int work_static(struct work_struct *work) { return 0; } in work_static() argument
217 * initialize all of a work item in one go
220 * assignment of the work data initializer allows the compiler
252 INIT_WORK(&(_work)->work, (_func)); \
260 INIT_WORK_ONSTACK(&(_work)->work, (_func)); \
279 INIT_WORK(&(_work)->work, (_func))
282 INIT_WORK_ONSTACK(&(_work)->work, (_func))
285 * work_pending - Find out whether a work item is currently pending
286 * @work: The work item in question
288 #define work_pending(work) \ argument
289 test_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(work))
292 * delayed_work_pending - Find out whether a delayable work item is currently
294 * @w: The work item in question
297 work_pending(&(w)->work)
320 * however, for example, a per-cpu work item scheduled from an
322 * execute the work item on that CPU breaking the idleness, which in
360 * system_highpri_wq is similar to system_wq but for work items which
392 * @max_active: max in-flight work items, 0 for default
412 * most one work item at any given time in the queued order. They are
439 struct work_struct *work);
441 struct work_struct *work);
443 struct delayed_work *work, unsigned long delay);
455 extern bool flush_work(struct work_struct *work);
456 extern bool cancel_work_sync(struct work_struct *work);
469 extern unsigned int work_busy(struct work_struct *work);
476 * queue_work - queue work on a workqueue
478 * @work: work to queue
480 * Returns %false if @work was already on a queue, %true otherwise.
482 * We queue the work to the CPU on which it was submitted, but if the CPU dies
487 * the CPU which will execute @work by the time such work executes, e.g.,
493 * WRITE_ONCE(x, 1); [ @work is being executed ]
494 * r0 = queue_work(wq, work); r1 = READ_ONCE(x);
499 struct work_struct *work) in queue_work() argument
501 return queue_work_on(WORK_CPU_UNBOUND, wq, work); in queue_work()
505 * queue_delayed_work - queue work on a workqueue after delay
507 * @dwork: delayable work to queue
520 * mod_delayed_work - modify delay of or queue a delayed work
522 * @dwork: work to queue
535 * schedule_work_on - put work task on a specific cpu
536 * @cpu: cpu to put the work task on
537 * @work: job to be done
541 static inline bool schedule_work_on(int cpu, struct work_struct *work) in schedule_work_on() argument
543 return queue_work_on(cpu, system_wq, work); in schedule_work_on()
547 * schedule_work - put work task in global workqueue
548 * @work: job to be done
550 * Returns %false if @work was already on the kernel-global workqueue and
560 static inline bool schedule_work(struct work_struct *work) in schedule_work() argument
562 return queue_work(system_wq, work); in schedule_work()
566 * flush_scheduled_work - ensure that any scheduled work has run to completion.
575 * One of the work items currently on the workqueue needs to acquire
578 * Your code is running in the context of a work routine.
581 * occur very often. It depends on what work items are on the workqueue and
585 * need to know that a particular work item isn't queued and isn't running.
595 * schedule_delayed_work_on - queue work in global workqueue on CPU after delay
610 * schedule_delayed_work - put work task in global workqueue after delay