aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
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 /kernel
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 'kernel')
-rw-r--r--kernel/workqueue.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index b57a8babdec3..2c6871cbcbee 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -2848,6 +2848,13 @@ struct workqueue_struct *__alloc_workqueue_key(const char *name,
2848 unsigned int cpu; 2848 unsigned int cpu;
2849 2849
2850 /* 2850 /*
2851 * Workqueues which may be used during memory reclaim should
2852 * have a rescuer to guarantee forward progress.
2853 */
2854 if (flags & WQ_MEM_RECLAIM)
2855 flags |= WQ_RESCUER;
2856
2857 /*
2851 * Unbound workqueues aren't concurrency managed and should be 2858 * Unbound workqueues aren't concurrency managed and should be
2852 * dispatched to workers immediately. 2859 * dispatched to workers immediately.
2853 */ 2860 */