lkml.org 
[lkml]   [2014]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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


\
 
 \ /
  Last update: 2014-05-16 15:01    [W:0.083 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site