lkml.org 
[lkml]   [2013]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH V2 06/15] workqueue: use current instead of worker->task in worker_maybe_bind_and_lock()
Date
worker_maybe_bind_and_lock() uses both @task and @current and the same time,
they are the same(worker_maybe_bind_and_lock() can only be called by current
worker task)

We make it uses @current only.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
kernel/workqueue.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 06d6211..b47d1af 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1560,7 +1560,7 @@ static void worker_leave_idle(struct worker *worker)
* flushed from cpu callbacks while cpu is going down, they are
* guaranteed to execute on the cpu.
*
- * This function is to be used by rogue workers and rescuers to bind
+ * This function is to be used by unbound workers and rescuers to bind
* themselves to the target cpu and may race with cpu going down or
* coming online. kthread_bind() can't be used because it may put the
* worker to already dead cpu and set_cpus_allowed_ptr() can't be used
@@ -1585,7 +1585,6 @@ static bool worker_maybe_bind_and_lock(struct worker *worker)
__acquires(&pool->lock)
{
struct worker_pool *pool = worker->pool;
- struct task_struct *task = worker->task;

while (true) {
/*
@@ -1595,12 +1594,12 @@ __acquires(&pool->lock)
* against POOL_DISASSOCIATED.
*/
if (!(pool->flags & POOL_DISASSOCIATED))
- set_cpus_allowed_ptr(task, get_cpu_mask(pool->cpu));
+ set_cpus_allowed_ptr(current, get_cpu_mask(pool->cpu));

spin_lock_irq(&pool->lock);
if (pool->flags & POOL_DISASSOCIATED)
return false;
- if (task_cpu(task) == pool->cpu &&
+ if (task_cpu(current) == pool->cpu &&
cpumask_equal(&current->cpus_allowed,
get_cpu_mask(pool->cpu)))
return true;
--
1.7.7.6


\
 
 \ /
  Last update: 2013-02-18 18:21    [W:0.459 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site