diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2014-05-20 05:46:31 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-05-20 10:59:31 -0400 |
commit | da028469ba173e9c634b6ecf80bb0c69c7d1024d (patch) | |
tree | 03fb68749d70240606157675161a47d9c367e213 /kernel/workqueue_internal.h | |
parent | 3347fc9f36e7e5d3ebe504fc4034745b5d8971d3 (diff) |
workqueue: separate iteration role from worker_idr
worker_idr has the iteration (iterating for attached workers) and
worker ID duties. These two duties don't have to be tied together. We
can separate them and use a list for tracking attached workers and
iteration.
Before this separation, it wasn't possible to add rescuer workers to
worker_idr due to rescuer workers couldn't allocate ID dynamically
because ID-allocation depends on memory-allocation, which rescuer
can't depend on.
After separation, we can easily add the rescuer workers to the list for
iteration without any memory-allocation. It is required when we attach
the rescuer worker to the pool in later patch.
tj: Minor description updates.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue_internal.h')
-rw-r--r-- | kernel/workqueue_internal.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/workqueue_internal.h b/kernel/workqueue_internal.h index 7e2204db0b1a..8888e0672442 100644 --- a/kernel/workqueue_internal.h +++ b/kernel/workqueue_internal.h | |||
@@ -37,6 +37,8 @@ struct worker { | |||
37 | struct task_struct *task; /* I: worker task */ | 37 | struct task_struct *task; /* I: worker task */ |
38 | struct worker_pool *pool; /* I: the associated pool */ | 38 | struct worker_pool *pool; /* I: the associated pool */ |
39 | /* L: for rescuers */ | 39 | /* L: for rescuers */ |
40 | struct list_head node; /* M: anchored at pool->workers */ | ||
41 | /* M: runs through worker->node */ | ||
40 | 42 | ||
41 | unsigned long last_active; /* L: last active timestamp */ | 43 | unsigned long last_active; /* L: last active timestamp */ |
42 | unsigned int flags; /* X: flags */ | 44 | unsigned int flags; /* X: flags */ |