[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.02.1405161412310.4039@ionos.tec.linutronix.de>
Date: Fri, 16 May 2014 14:14:05 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Tejun Heo <tj@...nel.org>
cc: Peter Zijlstra <peterz@...radead.org>,
Lai Jiangshan <laijs@...fujitsu.com>,
jjherne@...ux.vnet.ibm.com, Sasha Levin <sasha.levin@...cle.com>,
LKML <linux-kernel@...r.kernel.org>,
Dave Jones <davej@...hat.com>, Ingo Molnar <mingo@...hat.com>,
Steven Rostedt <rostedt@...dmis.org>
Subject: Re: workqueue: WARN at at kernel/workqueue.c:2176
On Fri, 16 May 2014, Tejun Heo wrote:
> On Fri, May 16, 2014 at 01:57:37PM +0200, Peter Zijlstra wrote:
> > This of course leaves the question how the workqueue code manages to
> > call set_cpu_allowed_ptr() on a cpu _before_ its online.
> >
> > That too sounds fishy.. with the proposed patch the
> > set_cpus_allowed_ptr() will 'gracefully' fail, but calling it in the
> > first place is of course dubious too.
>
> Right after being created, a workqueue worker invokes
> set_cpus_allowed_ptr() to the target cpumask without checking whether
> the cpu[s] are online or not and it's allowed to fail. The guarantee
> there is that the worker is already registered by that point and if a
> CPU comes online after the registration, CPU_ONLINE notification will
> update the cpumask accordingly, so either way the worker is guaranteed
> to be on the right cpumask.
That's what the kthread_create_on_cpu/kthread_park/kthread_unpark
infrastructure is for.
Thanks,
tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists