Commit 4e8f0a60 authored by Tejun Heo's avatar Tejun Heo

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: default avatarTejun Heo <tj@kernel.org>
Reviewed-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
parent 38db41d9
...@@ -123,7 +123,6 @@ enum { ...@@ -123,7 +123,6 @@ enum {
/* struct worker is defined in workqueue_internal.h */ /* struct worker is defined in workqueue_internal.h */
struct worker_pool { struct worker_pool {
struct global_cwq *gcwq; /* I: the owning gcwq */
spinlock_t lock; /* the pool lock */ spinlock_t lock; /* the pool lock */
unsigned int cpu; /* I: the associated cpu */ unsigned int cpu; /* I: the associated cpu */
int id; /* I: pool ID */ int id; /* I: pool ID */
...@@ -451,11 +450,6 @@ static DEFINE_IDR(worker_pool_idr); ...@@ -451,11 +450,6 @@ static DEFINE_IDR(worker_pool_idr);
static int worker_thread(void *__worker); static int worker_thread(void *__worker);
static int std_worker_pool_pri(struct worker_pool *pool)
{
return pool - pool->gcwq->pools;
}
static struct global_cwq *get_gcwq(unsigned int cpu) static struct global_cwq *get_gcwq(unsigned int cpu)
{ {
if (cpu != WORK_CPU_UNBOUND) if (cpu != WORK_CPU_UNBOUND)
...@@ -464,6 +458,11 @@ static struct global_cwq *get_gcwq(unsigned int cpu) ...@@ -464,6 +458,11 @@ static struct global_cwq *get_gcwq(unsigned int cpu)
return &unbound_global_cwq; return &unbound_global_cwq;
} }
static int std_worker_pool_pri(struct worker_pool *pool)
{
return pool - get_gcwq(pool->cpu)->pools;
}
/* allocate ID and assign it to @pool */ /* allocate ID and assign it to @pool */
static int worker_pool_assign_id(struct worker_pool *pool) static int worker_pool_assign_id(struct worker_pool *pool)
{ {
...@@ -3818,7 +3817,6 @@ static int __init init_workqueues(void) ...@@ -3818,7 +3817,6 @@ static int __init init_workqueues(void)
struct worker_pool *pool; struct worker_pool *pool;
for_each_std_worker_pool(pool, cpu) { for_each_std_worker_pool(pool, cpu) {
pool->gcwq = get_gcwq(cpu);
spin_lock_init(&pool->lock); spin_lock_init(&pool->lock);
pool->cpu = cpu; pool->cpu = cpu;
pool->flags |= POOL_DISASSOCIATED; pool->flags |= POOL_DISASSOCIATED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment