aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-01-24 14:01:34 -0500
committerTejun Heo <tj@kernel.org>2013-01-24 14:01:34 -0500
commit4e8f0a609677a25f504527e50981df146c5b3d08 (patch)
treee8fc37f309cf58c18bc2d0f0dfc00ccbadda7f4d /kernel
parent38db41d984f17938631420ff78160dda7f182d24 (diff)
workqueue: remove worker_pool->gcwq
The only remaining user of pool->gcwq is std_worker_pool_pri(). Reimplement it using get_gcwq() and remove worker_pool->gcwq. This is part of an effort to remove global_cwq and make worker_pool the top level abstraction, which in turn will help implementing worker pools with user-specified attributes. Signed-off-by: Tejun Heo <tj@kernel.org> Reviewed-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/workqueue.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index bd639c185da1..475a447aa6d8 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -123,7 +123,6 @@ enum {
123/* struct worker is defined in workqueue_internal.h */ 123/* struct worker is defined in workqueue_internal.h */
124 124
125struct worker_pool { 125struct worker_pool {
126 struct global_cwq *gcwq; /* I: the owning gcwq */
127 spinlock_t lock; /* the pool lock */ 126 spinlock_t lock; /* the pool lock */
128 unsigned int cpu; /* I: the associated cpu */ 127 unsigned int cpu; /* I: the associated cpu */
129 int id; /* I: pool ID */ 128 int id; /* I: pool ID */
@@ -451,11 +450,6 @@ static DEFINE_IDR(worker_pool_idr);
451 450
452static int worker_thread(void *__worker); 451static int worker_thread(void *__worker);
453 452
454static int std_worker_pool_pri(struct worker_pool *pool)
455{
456 return pool - pool->gcwq->pools;
457}
458
459static struct global_cwq *get_gcwq(unsigned int cpu) 453static struct global_cwq *get_gcwq(unsigned int cpu)
460{ 454{
461 if (cpu != WORK_CPU_UNBOUND) 455 if (cpu != WORK_CPU_UNBOUND)
@@ -464,6 +458,11 @@ static struct global_cwq *get_gcwq(unsigned int cpu)
464 return &unbound_global_cwq; 458 return &unbound_global_cwq;
465} 459}
466 460
461static int std_worker_pool_pri(struct worker_pool *pool)
462{
463 return pool - get_gcwq(pool->cpu)->pools;
464}
465
467/* allocate ID and assign it to @pool */ 466/* allocate ID and assign it to @pool */
468static int worker_pool_assign_id(struct worker_pool *pool) 467static int worker_pool_assign_id(struct worker_pool *pool)
469{ 468{
@@ -3818,7 +3817,6 @@ static int __init init_workqueues(void)
3818 struct worker_pool *pool; 3817 struct worker_pool *pool;
3819 3818
3820 for_each_std_worker_pool(pool, cpu) { 3819 for_each_std_worker_pool(pool, cpu) {
3821 pool->gcwq = get_gcwq(cpu);
3822 spin_lock_init(&pool->lock); 3820 spin_lock_init(&pool->lock);
3823 pool->cpu = cpu; 3821 pool->cpu = cpu;
3824 pool->flags |= POOL_DISASSOCIATED; 3822 pool->flags |= POOL_DISASSOCIATED;