Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 365491
b: refs/heads/master
c: 4e1a1f9
h: refs/heads/master
i:
  365489: ded955c
  365487: 1a9a5a7
v: v3
  • Loading branch information
Tejun Heo committed Mar 12, 2013
1 parent a5bd67f commit 5907034
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 34a06bd6b6fa92ccd9d3e6866b6cb91264c3cd20
refs/heads/master: 4e1a1f9a051b4c9a2821a2a0f7f4a27c701fba51
37 changes: 21 additions & 16 deletions trunk/kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -3123,6 +3123,26 @@ int keventd_up(void)
return system_wq != NULL;
}

static void init_worker_pool(struct worker_pool *pool)
{
spin_lock_init(&pool->lock);
pool->flags |= POOL_DISASSOCIATED;
INIT_LIST_HEAD(&pool->worklist);
INIT_LIST_HEAD(&pool->idle_list);
hash_init(pool->busy_hash);

init_timer_deferrable(&pool->idle_timer);
pool->idle_timer.function = idle_worker_timeout;
pool->idle_timer.data = (unsigned long)pool;

setup_timer(&pool->mayday_timer, pool_mayday_timeout,
(unsigned long)pool);

mutex_init(&pool->manager_arb);
mutex_init(&pool->assoc_mutex);
ida_init(&pool->worker_ida);
}

static int alloc_and_link_pwqs(struct workqueue_struct *wq)
{
bool highpri = wq->flags & WQ_HIGHPRI;
Expand Down Expand Up @@ -3790,23 +3810,8 @@ static int __init init_workqueues(void)
struct worker_pool *pool;

for_each_std_worker_pool(pool, cpu) {
spin_lock_init(&pool->lock);
init_worker_pool(pool);
pool->cpu = cpu;
pool->flags |= POOL_DISASSOCIATED;
INIT_LIST_HEAD(&pool->worklist);
INIT_LIST_HEAD(&pool->idle_list);
hash_init(pool->busy_hash);

init_timer_deferrable(&pool->idle_timer);
pool->idle_timer.function = idle_worker_timeout;
pool->idle_timer.data = (unsigned long)pool;

setup_timer(&pool->mayday_timer, pool_mayday_timeout,
(unsigned long)pool);

mutex_init(&pool->manager_arb);
mutex_init(&pool->assoc_mutex);
ida_init(&pool->worker_ida);

/* alloc pool ID */
BUG_ON(worker_pool_assign_id(pool));
Expand Down

0 comments on commit 5907034

Please sign in to comment.