Skip to content

Commit e6877ee

Browse files
author
Lai Jiangshan
committed
workqueue: use current instead of worker->task in worker_maybe_bind_and_lock()
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
1 parent fc58454 commit e6877ee

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

kernel/workqueue.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,7 +1560,7 @@ static void worker_leave_idle(struct worker *worker)
15601560
* flushed from cpu callbacks while cpu is going down, they are
15611561
* guaranteed to execute on the cpu.
15621562
*
1563-
* This function is to be used by rogue workers and rescuers to bind
1563+
* This function is to be used by unbound workers and rescuers to bind
15641564
* themselves to the target cpu and may race with cpu going down or
15651565
* coming online. kthread_bind() can't be used because it may put the
15661566
* 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)
15851585
__acquires(&pool->lock)
15861586
{
15871587
struct worker_pool *pool = worker->pool;
1588-
struct task_struct *task = worker->task;
15891588

15901589
while (true) {
15911590
/*
@@ -1595,12 +1594,12 @@ __acquires(&pool->lock)
15951594
* against POOL_DISASSOCIATED.
15961595
*/
15971596
if (!(pool->flags & POOL_DISASSOCIATED))
1598-
set_cpus_allowed_ptr(task, get_cpu_mask(pool->cpu));
1597+
set_cpus_allowed_ptr(current, get_cpu_mask(pool->cpu));
15991598

16001599
spin_lock_irq(&pool->lock);
16011600
if (pool->flags & POOL_DISASSOCIATED)
16021601
return false;
1603-
if (task_cpu(task) == pool->cpu &&
1602+
if (task_cpu(current) == pool->cpu &&
16041603
cpumask_equal(&current->cpus_allowed,
16051604
get_cpu_mask(pool->cpu)))
16061605
return true;

0 commit comments

Comments
 (0)