diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2014-05-22 04:44:07 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-05-22 11:35:51 -0400 |
commit | 1037de36edae30f1ddc0a2532decd50f92ac4901 (patch) | |
tree | 3b79dc2d386d79ae339161a1e3cde1f0665d1ea0 /kernel | |
parent | cafebac153ae54fd0aba5d4ad28af995532c5375 (diff) |
workqueue: rename first_worker() to first_idle_worker()
first_worker() actually returns the first idle workers, the name
first_idle_worker() which is self-commnet will be better.
All the callers of first_worker() expect it returns an idle worker,
the name first_idle_worker() with "idle" notation makes reviewers happier.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/workqueue.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 6603923b7ede..dd107b83f45f 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -773,8 +773,8 @@ static bool too_many_workers(struct worker_pool *pool) | |||
773 | * Wake up functions. | 773 | * Wake up functions. |
774 | */ | 774 | */ |
775 | 775 | ||
776 | /* Return the first worker. Safe with preemption disabled */ | 776 | /* Return the first idle worker. Safe with preemption disabled */ |
777 | static struct worker *first_worker(struct worker_pool *pool) | 777 | static struct worker *first_idle_worker(struct worker_pool *pool) |
778 | { | 778 | { |
779 | if (unlikely(list_empty(&pool->idle_list))) | 779 | if (unlikely(list_empty(&pool->idle_list))) |
780 | return NULL; | 780 | return NULL; |
@@ -793,7 +793,7 @@ static struct worker *first_worker(struct worker_pool *pool) | |||
793 | */ | 793 | */ |
794 | static void wake_up_worker(struct worker_pool *pool) | 794 | static void wake_up_worker(struct worker_pool *pool) |
795 | { | 795 | { |
796 | struct worker *worker = first_worker(pool); | 796 | struct worker *worker = first_idle_worker(pool); |
797 | 797 | ||
798 | if (likely(worker)) | 798 | if (likely(worker)) |
799 | wake_up_process(worker->task); | 799 | wake_up_process(worker->task); |
@@ -867,7 +867,7 @@ struct task_struct *wq_worker_sleeping(struct task_struct *task, int cpu) | |||
867 | */ | 867 | */ |
868 | if (atomic_dec_and_test(&pool->nr_running) && | 868 | if (atomic_dec_and_test(&pool->nr_running) && |
869 | !list_empty(&pool->worklist)) | 869 | !list_empty(&pool->worklist)) |
870 | to_wakeup = first_worker(pool); | 870 | to_wakeup = first_idle_worker(pool); |
871 | return to_wakeup ? to_wakeup->task : NULL; | 871 | return to_wakeup ? to_wakeup->task : NULL; |
872 | } | 872 | } |
873 | 873 | ||
@@ -3475,7 +3475,7 @@ static void put_unbound_pool(struct worker_pool *pool) | |||
3475 | mutex_lock(&pool->manager_arb); | 3475 | mutex_lock(&pool->manager_arb); |
3476 | 3476 | ||
3477 | spin_lock_irq(&pool->lock); | 3477 | spin_lock_irq(&pool->lock); |
3478 | while ((worker = first_worker(pool))) | 3478 | while ((worker = first_idle_worker(pool))) |
3479 | destroy_worker(worker); | 3479 | destroy_worker(worker); |
3480 | WARN_ON(pool->nr_workers || pool->nr_idle); | 3480 | WARN_ON(pool->nr_workers || pool->nr_idle); |
3481 | spin_unlock_irq(&pool->lock); | 3481 | spin_unlock_irq(&pool->lock); |