[PATCH 1/3] workqueue: remove the first check and the return value of maybe_create_worker()

2014-07-10 Thread Lai Jiangshan
The pool->lock is kept locked during the time the worker_thread() checks the condition and maybe_create_worker() is called, therefore, the condition is unchanged and the first condition check is unneeded. After this unneeded check is removed, maybe_create_worker() only returns true, so we remove t

Re: [PATCH 1/3] workqueue: remove the first check and the return value of maybe_create_worker()

2014-07-11 Thread Tejun Heo
On Fri, Jul 11, 2014 at 12:01:03AM +0800, Lai Jiangshan wrote: > @@ -1887,17 +1887,11 @@ static void pool_mayday_timeout(unsigned long __pool) > * spin_lock_irq(pool->lock) which may be released and regrabbed > * multiple times. Does GFP_KERNEL allocations. Called only from > * manager. > -

Re: [PATCH 1/3] workqueue: remove the first check and the return value of maybe_create_worker()

2014-07-13 Thread Lai Jiangshan
On 07/11/2014 11:03 PM, Tejun Heo wrote: > On Fri, Jul 11, 2014 at 12:01:03AM +0800, Lai Jiangshan wrote: >> @@ -1887,17 +1887,11 @@ static void pool_mayday_timeout(unsigned long __pool) >> * spin_lock_irq(pool->lock) which may be released and regrabbed >> * multiple times. Does GFP_KERNEL all

Re: [PATCH 1/3] workqueue: remove the first check and the return value of maybe_create_worker()

2014-07-14 Thread Tejun Heo
On Mon, Jul 14, 2014 at 10:30:11AM +0800, Lai Jiangshan wrote: > We already have create_worker(). And maybe_create_worker() does not always > create worker. Well, it does unless it fails. Explicit maybe_ there is quite misleading. > maybe_create_worker() may not create worker if the condition i