diff options
author | Tejun Heo <tj@kernel.org> | 2013-03-12 14:30:04 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-03-12 14:30:04 -0400 |
commit | 618b01eb426dd2d73a4b5e5ebc6379e4eee3b123 (patch) | |
tree | 9068381e7a25dde3d4d72fd8b9fe8a814bc85efe | |
parent | 9e8cd2f5898ab6710ad81f4583fada08bf8049a4 (diff) |
workqueue: make it clear that WQ_DRAINING is an internal flag
We're gonna add another internal WQ flag. Let's make the distinction
clear. Prefix WQ_DRAINING with __ and move it to bit 16.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Lai Jiangshan <laijs@cn.fujitsu.com>
-rw-r--r-- | include/linux/workqueue.h | 2 | ||||
-rw-r--r-- | kernel/workqueue.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index e152394fa7eb..1751ec4c47c9 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -294,7 +294,7 @@ enum { | |||
294 | WQ_HIGHPRI = 1 << 4, /* high priority */ | 294 | WQ_HIGHPRI = 1 << 4, /* high priority */ |
295 | WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ | 295 | WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ |
296 | 296 | ||
297 | WQ_DRAINING = 1 << 6, /* internal: workqueue is draining */ | 297 | __WQ_DRAINING = 1 << 16, /* internal: workqueue is draining */ |
298 | 298 | ||
299 | WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */ | 299 | WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */ |
300 | WQ_MAX_UNBOUND_PER_CPU = 4, /* 4 * #cpus for unbound wq */ | 300 | WQ_MAX_UNBOUND_PER_CPU = 4, /* 4 * #cpus for unbound wq */ |
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 2a67fbbd192c..590f4d048ec7 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -1225,7 +1225,7 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, | |||
1225 | debug_work_activate(work); | 1225 | debug_work_activate(work); |
1226 | 1226 | ||
1227 | /* if dying, only works from the same workqueue are allowed */ | 1227 | /* if dying, only works from the same workqueue are allowed */ |
1228 | if (unlikely(wq->flags & WQ_DRAINING) && | 1228 | if (unlikely(wq->flags & __WQ_DRAINING) && |
1229 | WARN_ON_ONCE(!is_chained_work(wq))) | 1229 | WARN_ON_ONCE(!is_chained_work(wq))) |
1230 | return; | 1230 | return; |
1231 | retry: | 1231 | retry: |
@@ -2763,11 +2763,11 @@ void drain_workqueue(struct workqueue_struct *wq) | |||
2763 | /* | 2763 | /* |
2764 | * __queue_work() needs to test whether there are drainers, is much | 2764 | * __queue_work() needs to test whether there are drainers, is much |
2765 | * hotter than drain_workqueue() and already looks at @wq->flags. | 2765 | * hotter than drain_workqueue() and already looks at @wq->flags. |
2766 | * Use WQ_DRAINING so that queue doesn't have to check nr_drainers. | 2766 | * Use __WQ_DRAINING so that queue doesn't have to check nr_drainers. |
2767 | */ | 2767 | */ |
2768 | spin_lock_irq(&workqueue_lock); | 2768 | spin_lock_irq(&workqueue_lock); |
2769 | if (!wq->nr_drainers++) | 2769 | if (!wq->nr_drainers++) |
2770 | wq->flags |= WQ_DRAINING; | 2770 | wq->flags |= __WQ_DRAINING; |
2771 | spin_unlock_irq(&workqueue_lock); | 2771 | spin_unlock_irq(&workqueue_lock); |
2772 | reflush: | 2772 | reflush: |
2773 | flush_workqueue(wq); | 2773 | flush_workqueue(wq); |
@@ -2795,7 +2795,7 @@ reflush: | |||
2795 | 2795 | ||
2796 | spin_lock(&workqueue_lock); | 2796 | spin_lock(&workqueue_lock); |
2797 | if (!--wq->nr_drainers) | 2797 | if (!--wq->nr_drainers) |
2798 | wq->flags &= ~WQ_DRAINING; | 2798 | wq->flags &= ~__WQ_DRAINING; |
2799 | spin_unlock(&workqueue_lock); | 2799 | spin_unlock(&workqueue_lock); |
2800 | 2800 | ||
2801 | local_irq_enable(); | 2801 | local_irq_enable(); |