diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2013-02-19 15:17:01 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-03-04 12:44:57 -0500 |
commit | 45d9550a0e7e9230606ca3c4c6f4dc6297848b2f (patch) | |
tree | f7630d4336447782233f333379ffdd2c258f8b01 /include/linux/workqueue.h | |
parent | 6dbe51c251a327e012439c4772097a13df43c5b8 (diff) |
workqueue: allow more off-queue flag space
When a work item is off-queue, its work->data contains WORK_STRUCT_*
and WORK_OFFQ_* flags. As WORK_OFFQ_* flags are used only while a
work item is off-queue, it can occupy bits of work->data which aren't
used while off-queue. WORK_OFFQ_* currently only use bits used by
on-queue CWQ pointer. As color bits aren't used while off-queue,
there's no reason to not use them.
Lower WORK_OFFQ_FLAG_BASE from WORK_STRUCT_FLAG_BITS to
WORK_STRUCT_COLOR_SHIFT thus giving 4 more bits to off-queue flag
space which is also used to record worker_pool ID while off-queue.
This doesn't introduce any visible behavior difference.
tj: Rewrote the description.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/workqueue.h')
-rw-r--r-- | include/linux/workqueue.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 8afab27cdbc2..5bd030f630a9 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -68,7 +68,7 @@ enum { | |||
68 | WORK_STRUCT_COLOR_BITS, | 68 | WORK_STRUCT_COLOR_BITS, |
69 | 69 | ||
70 | /* data contains off-queue information when !WORK_STRUCT_PWQ */ | 70 | /* data contains off-queue information when !WORK_STRUCT_PWQ */ |
71 | WORK_OFFQ_FLAG_BASE = WORK_STRUCT_FLAG_BITS, | 71 | WORK_OFFQ_FLAG_BASE = WORK_STRUCT_COLOR_SHIFT, |
72 | 72 | ||
73 | WORK_OFFQ_CANCELING = (1 << WORK_OFFQ_FLAG_BASE), | 73 | WORK_OFFQ_CANCELING = (1 << WORK_OFFQ_FLAG_BASE), |
74 | 74 | ||