Lines Matching full:work

17 When such an asynchronous execution context is needed, a work item
22 While there are work items on the workqueue the worker executes the
23 functions associated with the work items one after the other. When
24 there is no work item left on the workqueue the worker becomes idle.
25 When a new work item gets queued, the worker begins executing again.
43 while an ST wq one for the whole system. Work items had to compete for
72 abstraction, the work item, is introduced.
74 A work item is a simple struct that holds a pointer to the function
76 wants a function to be executed asynchronously it has to set up a work
77 item pointing to that function and queue that work item on a
80 A work item can be executed in either a thread or the BH (softirq) context.
83 the functions off of the queue, one after the other. If no work is queued,
88 subsystems and drivers queue work items on and the backend mechanism
89 which manages worker-pools and processes the queued work items.
91 There are two worker-pools, one for normal work items and the other
93 worker-pools to serve work items queued on unbound workqueues - the
102 Subsystems and drivers can create and queue work items through special
104 aspects of the way the work items are executed by setting flags on the
105 workqueue they are putting the work item on. These flags include
110 When a work item is queued to a workqueue, the target worker-pool is
113 unless specifically overridden, a work item of a bound workqueue will
126 number of the currently runnable workers. Generally, work items are
128 maintaining just enough concurrency to prevent work processing from
131 work, but, when the last running worker goes to sleep, it immediately
133 are pending work items. This allows using a minimal number of workers
150 through the use of rescue workers. All work items which might be used
167 forward progress guarantee, flush and work item attributes. ``@flags``
168 and ``@max_active`` control how work items are assigned execution
177 workqueues are always per-CPU and all BH work items are executed in the
183 BH work items cannot sleep. All other features such as delayed queueing,
187 Work items queued to an unbound wq are served by the special
191 worker-pools try to start execution of work items as soon as
205 suspend operations. Work items on the wq are drained and no
206 new work item starts execution until thawed.
214 Work items of a highpri wq are queued to the highpri
223 Work items of a CPU intensive wq do not contribute to the
225 work items will not prevent other work items in the same
227 work items which are expected to hog CPU cycles so that their
230 Although CPU intensive work items don't contribute to the
233 non-CPU-intensive work items can delay execution of CPU
234 intensive work items.
243 CPU which can be assigned to the work items of a wq. For example, with
244 ``@max_active`` of 16, at most 16 work items of the wq can be executing
253 The number of active work items of a wq is usually regulated by the
254 users of the wq, more specifically, by how many work items the users
256 throttling the number of active work items, specifying '0' is
259 Some users depend on strict execution ordering where only one work item
260 is in flight at any given time and the work items are processed in
272 Work items w0, w1, w2 are queued to a bound wq q0 on the same CPU.
339 * Do not forget to use ``WQ_MEM_RECLAIM`` if a wq may process work
342 there is dependency among multiple work items used during memory
353 (``WQ_MEM_RECLAIM``, flush and work item attributes. Work items
355 flushed as a part of a group of work items, and don't require any
361 work items (do stress test your producers), it may saturate a system
365 * Unless work items are expected to consume a huge amount of CPU
367 level of locality in wq operations and work item execution.
376 boundaries. A work item queued on the workqueue will be assigned to a worker
388 CPUs are not grouped. A work item issued on one CPU is processed by a
406 work item on a CPU close to the issuing CPU.
423 0 by default indicating that affinity scopes are not strict. When a work
446 Higher locality leads to higher efficiency where more work is performed for
448 cause lower overall system utilization if the work items are not spread
458 Scenario 1: Enough issuers and work spread across the machine
500 Scenario 2: Fewer issuers, enough work for saturation
510 a third of the issuers but is still enough total work to saturate the
533 This is more than enough work to saturate the system. Both "system" and
539 (strict)" to mostly saturate the machine but the loss of work conservation
543 Scenario 3: Even fewer issuers, not enough work to saturate
553 reduced to four, there now isn't enough work to saturate the whole system
588 While the loss of work-conservation in certain scenarios hurts, it is a lot
605 * The loss of work-conservation in non-strict affinity scopes is likely
608 work-conservation in most cases. As such, it is possible that future
723 Because the work functions are executed by generic worker threads
738 2. A single work item that consumes lots of cpu cycles
747 If something is busy looping on work queueing, it would be dominating
748 the output and the offender can be determined with the work item
756 The work item's function should be trivially visible in the stack
763 Workqueue guarantees that a work item cannot be re-entrant if the following
764 conditions hold after a work item gets queued:
766 1. The work function hasn't been changed.
767 2. No one queues the work item to another workqueue.
768 3. The work item hasn't been reinitiated.
770 In other words, if the above conditions hold, the work item is guaranteed to be
773 Note that requeuing the work item (to the same queue) in the self function
775 required when breaking the conditions inside a work function.