[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141204145722.GC15219@htj.dyndns.org>
Date: Thu, 4 Dec 2014 09:57:22 -0500
From: Tejun Heo <tj@...nel.org>
To: Lai Jiangshan <laijs@...fujitsu.com>
Cc: NeilBrown <neilb@...e.de>, Jan Kara <jack@...e.cz>,
Dongsu Park <dongsu.park@...fitbricks.com>,
linux-kernel@...r.kernel.org
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
--
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