Messages in this thread | | | Date | Thu, 4 Dec 2014 09:57:22 -0500 | From | Tejun Heo <> | Subject | Re: [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
| |