Lines Matching +full:idle +full:- +full:wait +full:- +full:delay

1 /* SPDX-License-Identifier: GPL-2.0 */
3 * workqueue.h --- work queue handling for Linux.
28 #define work_data_bits(work) ((unsigned long *)(&(work)->data))
67 /* data contains off-queue information when !WORK_STRUCT_PWQ */
80 WORK_OFFQ_LEFT = BITS_PER_LONG - WORK_OFFQ_POOL_SHIFT,
82 WORK_OFFQ_POOL_NONE = (1LU << WORK_OFFQ_POOL_BITS) - 1,
85 WORK_STRUCT_FLAG_MASK = (1UL << WORK_STRUCT_FLAG_BITS) - 1,
114 /* target workqueue and CPU ->timer uses to queue ->work */
123 /* target workqueue ->rcu uses to queue ->work */
128 * struct workqueue_attrs - A struct for workqueue attributes.
229 (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \
230 lockdep_init_map(&(_work)->lockdep_map, "(work_completion)"#_work, &__key, 0); \
231 INIT_LIST_HEAD(&(_work)->entry); \
232 (_work)->func = (_func); \
238 (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \
239 INIT_LIST_HEAD(&(_work)->entry); \
240 (_work)->func = (_func); \
252 INIT_WORK(&(_work)->work, (_func)); \
253 __init_timer(&(_work)->timer, \
260 INIT_WORK_ONSTACK(&(_work)->work, (_func)); \
261 __init_timer_on_stack(&(_work)->timer, \
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
292 * delayed_work_pending - Find out whether a delayable work item is currently
297 work_pending(&(w)->work)
301 * Documentation/core-api/workqueue.rst.
312 * Per-cpu workqueues are generally preferred because they tend to
313 * show better performance thanks to cache locality. Per-cpu
318 * The scheduler considers a CPU idle if it doesn't have any task
319 * to execute and tries to keep idle cores idle to conserve power;
320 * however, for example, a per-cpu work item scheduled from an
321 * interrupt handler on an idle CPU will force the scheduler to
323 * turn may lead to more scheduling choices which are sub-optimal
326 * Workqueues marked with WQ_POWER_EFFICIENT are per-cpu by default
328 * specified. Per-cpu workqueues which are identified to
329 * contribute significantly to power-consumption are identified and
348 /* unbound wq's aren't per-cpu, scale max_active according to #cpus */
353 * System-wide workqueues which are always present.
356 * Multi-CPU multi-threaded. There are users which expect relatively
376 * they are same as their non-power-efficient counterparts - e.g.
389 * alloc_workqueue - allocate a workqueue
392 * @max_active: max in-flight work items, 0 for default
397 * Documentation/core-api/workqueue.rst.
406 * alloc_ordered_workqueue - allocate an ordered workqueue
443 struct delayed_work *work, unsigned long delay);
445 struct delayed_work *dwork, unsigned long delay);
478 * queue_work - queue work on a workqueue
487 * Memory-ordering properties: If it returns %true, guarantees that all stores
507 * queue_delayed_work - queue work on a workqueue after delay
510 * @delay: number of jiffies to wait before queueing
516 unsigned long delay) in queue_delayed_work() argument
518 return queue_delayed_work_on(WORK_CPU_UNBOUND, wq, dwork, delay); in queue_delayed_work()
522 * mod_delayed_work - modify delay of or queue a delayed work
525 * @delay: number of jiffies to wait before queueing
531 unsigned long delay) in mod_delayed_work() argument
533 return mod_delayed_work_on(WORK_CPU_UNBOUND, wq, dwork, delay); in mod_delayed_work()
537 * schedule_work_on - put work task on a specific cpu
549 * schedule_work - put work task in global workqueue
552 * Returns %false if @work was already on the kernel-global workqueue and
555 * This puts a job in the kernel-global workqueue if it was not already
556 * queued and leaves it in the same position on the kernel-global
559 * Shares the same memory-ordering properties of queue_work(), cf. the
568 * Detect attempt to flush system-wide workqueues at compile time when possible.
570 * See https://lkml.kernel.org/r/49925af7-78a8-a3dd-bce6-cfc02e1a9236@I-love.SAKURA.ne.jp
571 * for reasons and steps for converting system-wide workqueues into local workqueues.
574 __compiletime_warning("Please avoid flushing system-wide workqueues.");
577 * flush_scheduled_work - ensure that any scheduled work has run to completion.
579 * Forces execution of the kernel-global workqueue and blocks until its
599 * Please stop calling this function! A conversion to stop flushing system-wide
600 * workqueues is in progress. This function will be removed after all in-tree
609 * there are in-tree users.
619 * Although there is no longer in-tree caller, for now just emit warning
620 * in order to give out-of-tree callers time to update.
645 * schedule_delayed_work_on - queue work in global workqueue on CPU after delay
648 * @delay: number of jiffies to wait
650 * After waiting for a given time this puts a job in the kernel-global
654 unsigned long delay) in schedule_delayed_work_on() argument
656 return queue_delayed_work_on(cpu, system_wq, dwork, delay); in schedule_delayed_work_on()
660 * schedule_delayed_work - put work task in global workqueue after delay
662 * @delay: number of jiffies to wait or 0 for immediate execution
664 * After waiting for a given time this puts a job in the kernel-global
668 unsigned long delay) in schedule_delayed_work() argument
670 return queue_delayed_work(system_wq, dwork, delay); in schedule_delayed_work()