aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/workqueue.txt
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-10-11 09:12:27 -0400
committerTejun Heo <tj@kernel.org>2010-10-11 09:20:26 -0400
commit6370a6ad3b53df90b4700977f7718118a2cd524a (patch)
tree2d1f45a19e66329813ce133b18f920d8c450b0c0 /Documentation/workqueue.txt
parent30310045dd20a286cf3800f063f79b468e132fb1 (diff)
workqueue: add and use WQ_MEM_RECLAIM flag
Add WQ_MEM_RECLAIM flag which currently maps to WQ_RESCUER, mark WQ_RESCUER as internal and replace all external WQ_RESCUER usages to WQ_MEM_RECLAIM. This makes the API users express the intent of the workqueue instead of indicating the internal mechanism used to guarantee forward progress. This is also to make it cleaner to add more semantics to WQ_MEM_RECLAIM. For example, if deemed necessary, memory reclaim workqueues can be made highpri. This patch doesn't introduce any functional change. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Jeff Garzik <jgarzik@pobox.com> Cc: Dave Chinner <david@fromorbit.com> Cc: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'Documentation/workqueue.txt')
-rw-r--r--Documentation/workqueue.txt29
1 files changed, 15 insertions, 14 deletions
diff --git a/Documentation/workqueue.txt b/Documentation/workqueue.txt
index e4498a2872c3..996a27d9b8db 100644
--- a/Documentation/workqueue.txt
+++ b/Documentation/workqueue.txt
@@ -196,11 +196,11 @@ resources, scheduled and executed.
196 suspend operations. Work items on the wq are drained and no 196 suspend operations. Work items on the wq are drained and no
197 new work item starts execution until thawed. 197 new work item starts execution until thawed.
198 198
199 WQ_RESCUER 199 WQ_MEM_RECLAIM
200 200
201 All wq which might be used in the memory reclaim paths _MUST_ 201 All wq which might be used in the memory reclaim paths _MUST_
202 have this flag set. This reserves one worker exclusively for 202 have this flag set. The wq is guaranteed to have at least one
203 the execution of this wq under memory pressure. 203 execution context regardless of memory pressure.
204 204
205 WQ_HIGHPRI 205 WQ_HIGHPRI
206 206
@@ -356,11 +356,11 @@ If q1 has WQ_CPU_INTENSIVE set,
356 356
3576. Guidelines 3576. Guidelines
358 358
359* Do not forget to use WQ_RESCUER if a wq may process work items which 359* Do not forget to use WQ_MEM_RECLAIM if a wq may process work items
360 are used during memory reclaim. Each wq with WQ_RESCUER set has one 360 which are used during memory reclaim. Each wq with WQ_MEM_RECLAIM
361 rescuer thread reserved for it. If there is dependency among 361 set has an execution context reserved for it. If there is
362 multiple work items used during memory reclaim, they should be 362 dependency among multiple work items used during memory reclaim,
363 queued to separate wq each with WQ_RESCUER. 363 they should be queued to separate wq each with WQ_MEM_RECLAIM.
364 364
365* Unless strict ordering is required, there is no need to use ST wq. 365* Unless strict ordering is required, there is no need to use ST wq.
366 366
@@ -368,12 +368,13 @@ If q1 has WQ_CPU_INTENSIVE set,
368 recommended. In most use cases, concurrency level usually stays 368 recommended. In most use cases, concurrency level usually stays
369 well under the default limit. 369 well under the default limit.
370 370
371* A wq serves as a domain for forward progress guarantee (WQ_RESCUER), 371* A wq serves as a domain for forward progress guarantee
372 flush and work item attributes. Work items which are not involved 372 (WQ_MEM_RECLAIM, flush and work item attributes. Work items which
373 in memory reclaim and don't need to be flushed as a part of a group 373 are not involved in memory reclaim and don't need to be flushed as a
374 of work items, and don't require any special attribute, can use one 374 part of a group of work items, and don't require any special
375 of the system wq. There is no difference in execution 375 attribute, can use one of the system wq. There is no difference in
376 characteristics between using a dedicated wq and a system wq. 376 execution characteristics between using a dedicated wq and a system
377 wq.
377 378
378* Unless work items are expected to consume a huge amount of CPU 379* Unless work items are expected to consume a huge amount of CPU
379 cycles, using a bound wq is usually beneficial due to the increased 380 cycles, using a bound wq is usually beneficial due to the increased