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_DELAYED_BIT = 1, /* work item is delayed */
34 WORK_STRUCT_LINKED_BIT = 3, /* next work is linked to this one */
79 * When a work item is off queue, its high bits point to the last
116 struct work_struct work; member
119 /* target workqueue and CPU ->timer uses to queue ->work */
125 struct work_struct work; member
128 /* target workqueue ->rcu uses to queue ->work */
158 static inline struct delayed_work *to_delayed_work(struct work_struct *work) in to_delayed_work() argument
160 return container_of(work, struct delayed_work, work); in to_delayed_work()
163 static inline struct rcu_work *to_rcu_work(struct work_struct *work) in to_rcu_work() argument
165 return container_of(work, struct rcu_work, work); in to_rcu_work()
169 struct work_struct work; member
192 .work = __WORK_INITIALIZER((n).work, (f)), \
207 extern void __init_work(struct work_struct *work, int onstack);
208 extern void destroy_work_on_stack(struct work_struct *work);
209 extern void destroy_delayed_work_on_stack(struct delayed_work *work);
210 static inline unsigned int work_static(struct work_struct *work) in work_static() argument
212 return *work_data_bits(work) & WORK_STRUCT_STATIC; in work_static()
215 static inline void __init_work(struct work_struct *work, int onstack) { } in __init_work() argument
216 static inline void destroy_work_on_stack(struct work_struct *work) { } in destroy_work_on_stack() argument
217 static inline void destroy_delayed_work_on_stack(struct delayed_work *work) { } in destroy_delayed_work_on_stack() argument
218 static inline unsigned int work_static(struct work_struct *work) { return 0; } in work_static() argument
222 * initialize all of a work item in one go
225 * assignment of the work data initializer allows the compiler
257 INIT_WORK(&(_work)->work, (_func)); \
265 INIT_WORK_ONSTACK(&(_work)->work, (_func)); \
284 INIT_WORK(&(_work)->work, (_func))
287 INIT_WORK_ONSTACK(&(_work)->work, (_func))
290 * work_pending - Find out whether a work item is currently pending
291 * @work: The work item in question
293 #define work_pending(work) \ argument
294 test_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(work))
297 * delayed_work_pending - Find out whether a delayable work item is currently
299 * @w: The work item in question
302 work_pending(&(w)->work)
325 * however, for example, a per-cpu work item scheduled from an
327 * excute the work item on that CPU breaking the idleness, which in
365 * system_highpri_wq is similar to system_wq but for work items which
397 * @max_active: max in-flight work items, 0 for default
418 * most one work item at any given time in the queued order. They are
445 struct work_struct *work);
447 struct work_struct *work);
449 struct delayed_work *work, unsigned long delay);
461 extern bool flush_work(struct work_struct *work);
462 extern bool cancel_work_sync(struct work_struct *work);
475 extern unsigned int work_busy(struct work_struct *work);
482 * queue_work - queue work on a workqueue
484 * @work: work to queue
486 * Returns %false if @work was already on a queue, %true otherwise.
488 * We queue the work to the CPU on which it was submitted, but if the CPU dies
493 * the CPU which will execute @work by the time such work executes, e.g.,
499 * WRITE_ONCE(x, 1); [ @work is being executed ]
500 * r0 = queue_work(wq, work); r1 = READ_ONCE(x);
505 struct work_struct *work) in queue_work() argument
507 return queue_work_on(WORK_CPU_UNBOUND, wq, work); in queue_work()
511 * queue_delayed_work - queue work on a workqueue after delay
513 * @dwork: delayable work to queue
526 * mod_delayed_work - modify delay of or queue a delayed work
528 * @dwork: work to queue
541 * schedule_work_on - put work task on a specific cpu
542 * @cpu: cpu to put the work task on
543 * @work: job to be done
547 static inline bool schedule_work_on(int cpu, struct work_struct *work) in schedule_work_on() argument
549 return queue_work_on(cpu, system_wq, work); in schedule_work_on()
553 * schedule_work - put work task in global workqueue
554 * @work: job to be done
556 * Returns %false if @work was already on the kernel-global workqueue and
566 static inline bool schedule_work(struct work_struct *work) in schedule_work() argument
568 return queue_work(system_wq, work); in schedule_work()
572 * flush_scheduled_work - ensure that any scheduled work has run to completion.
581 * One of the work items currently on the workqueue needs to acquire
584 * Your code is running in the context of a work routine.
587 * occur very often. It depends on what work items are on the workqueue and
591 * need to know that a particular work item isn't queued and isn't running.
601 * schedule_delayed_work_on - queue work in global workqueue on CPU after delay
616 * schedule_delayed_work - put work task in global workqueue after delay