lkml.org 
[lkml]   [2013]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 15/21] workqueue: remove worker_maybe_bind_and_lock()
On Wed, Mar 20, 2013 at 03:28:15AM +0800, Lai Jiangshan wrote:
> static struct worker *alloc_worker(void)
> {
> struct worker *worker;
> @@ -2326,7 +2262,8 @@ repeat:
> spin_unlock_irq(&wq_mayday_lock);
>
> /* migrate to the target cpu if possible */
> - worker_maybe_bind_and_lock(pool);
> + set_cpus_allowed_ptr(current, pool->attrs->cpumask);
> + spin_lock_irq(&pool->lock);
> rescuer->pool = pool;

You can't do this. The CPU might go up between set_cpus_allowed_ptr()
and spin_lock_irq() and the rescuer can end up executing a work item
which was issued while the target CPU is up on the wrong CPU.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2013-03-20 22:45    [W:0.909 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site