lkml.org 
[lkml]   [2014]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH - v3?] workqueue: allow rescuer thread to do more work.
On Thu, Dec 04, 2014 at 09:01:50AM +0800, Lai Jiangshan wrote:
> > + if (need_to_create_worker(pool)) {
> > + spin_lock(&wq_mayday_lock);
> > + list_move_tail(&pwq->mayday_node, &wq->maydays);
>
> how about the pwq is empty now? and ...

It will be taken off list the next round. It's silly to scan the list
again here. The only thing that'd do is adding more code and adding
an extra scan when the pwq actually needs to be requeued.

> > + spin_unlock(&wq_mayday_lock);
> > + }
> > + }
> >
> > /*
> > * Put the reference grabbed by send_mayday(). @pool won't
>
> and the pwq is scheduled free here>

Added get_pwq() before list_move_tail() as Dongsu suggested.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2014-12-04 16:21    [W:0.116 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site