[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140516121631.GB13288@mtj.dyndns.org>
Date: Fri, 16 May 2014 08:16:31 -0400
From: Tejun Heo <tj@...nel.org>
To: Thomas Gleixner <tglx@...utronix.de>
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, May 16, 2014 at 02:14:05PM +0200, Thomas Gleixner wrote:
> 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.
They aren't necessarily on one CPU. Unbound workqueues can have
arbitrary cpumasks associated with them.
Thanks.
--
tejun
--
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