mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] workqueue: fix possible bug which may silence the pool
Date: Tue, 5 Mar 2013 10:04:46 -0800	[thread overview]
Message-ID: <20130305180446.GH12795@htj.dyndns.org> (raw)
In-Reply-To: <5135479C.4060209@cn.fujitsu.com>

Hello, Lai.

On Tue, Mar 05, 2013 at 09:17:16AM +0800, Lai Jiangshan wrote:
> > But can we please just addd wake_up_worker() in the
> > for_each_std_worker_pool() loop?  
> 
> wake_up_worker() needed be put on the same loop which do set %WORKER_UNBOUND.
> 
> mutex_lock(&pool->assoc_mutex);
> do set %WORKER_UNBOUND for normal_pri pool
> mutex_unlock(&pool->assoc_mutex);
> 
> // no wakeup for normal_pri pool
> // but all workers of normal_pri pool goto sleep
> 
> // try to  do set %WORKER_UNBOUND for high_pri pool
> mutex_lock(&pool->assoc_mutex);
> 	waiting forever here due to high_pri pool's manage_workers()
> 	waiting on allocating memory forever(waiting normal_pri pool
> 	free memory, but normal_pri pool is silenced)
> mutex_unlock(&pool->assoc_mutex);

Hmmm.... I see.  Can you please separate it into two patches then?
One to restructure the loop into one and the other to add wake up,
and add comment explaining why the loop has to be per-pool?

Thanks.

-- 
tejun

  reply	other threads:[~2013-03-05 18:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-02 15:55 Lai Jiangshan
2013-03-04 19:20 ` Tejun Heo
2013-03-05  1:17   ` Lai Jiangshan
2013-03-05 18:04     ` Tejun Heo [this message]
2013-03-08 23:15 ` [PATCH wq/for-3.9-fixes] workqueue: fix possible pool stall bug in wq_unbind_fn() Tejun Heo
2013-03-11 16:09   ` Lai Jiangshan
2013-03-11 16:24     ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130305180446.GH12795@htj.dyndns.org \
    --to=tj@kernel.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®