From: Tejun Heo <tj@kernel.org>
To: Boqun Feng <boqun.feng@gmail.com>
Cc: linux-kernel@vger.kernel.org, Josef Bacik <josef@toxicpanda.com>,
Peter Zijlstra <peterz@infradead.org>,
Lai Jiangshan <jiangshanlai@gmail.com>
Subject: Re: [PATCH workqueue/for-4.14-fixes] workqueue: replace pool->manager_arb mutex with a flag
Date: Mon, 9 Oct 2017 07:47:02 -0700 [thread overview]
Message-ID: <20171009144702.GB3301751@devbig577.frc2.facebook.com> (raw)
In-Reply-To: <20171009142117.trbabd6m656ljf7w@tardis>
Hello, Boqun.
On Mon, Oct 09, 2017 at 10:21:17PM +0800, Boqun Feng wrote:
> > +static DECLARE_WAIT_QUEUE_HEAD(wq_manager_wait); /* wait for manager to go away */
>
> I think this wait_queue_head better be a per-pool one rather than shared
> among pools?
It should be fine either way. All the involved operations are pretty
low frequency.
> > @@ -3338,7 +3332,10 @@ static void put_unbound_pool(struct worker_pool *pool)
> > if (pool->detach_completion)
> > wait_for_completion(pool->detach_completion);
> >
> > - mutex_unlock(&pool->manager_arb);
> > + spin_lock_irq(&pool->lock);
> > + pool->flags &= ~POOL_MANAGER_ACTIVE;
> > + wake_up(&wq_manager_wait);
> > + spin_unlock_irq(&pool->lock);
> >
>
> Is the above code necesarry? IIUC, we are going to free the pool
> entirely, so whether manager is active is pointless here and no one is
> waiting for the ->flags of *this* pool to be !POOL_MANAGER_ACTIVE.
>
> Am I missing something subtle here?
Ah, true. I'll drop the above chunk.
Thanks.
--
tejun
next prev parent reply other threads:[~2017-10-09 14:47 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-08 9:02 [RFC] workqueue: Fix irq inversion deadlock in manage_workers() Boqun Feng
2017-10-08 19:03 ` Tejun Heo
2017-10-09 3:24 ` Boqun Feng
2017-10-09 6:42 ` Peter Zijlstra
2017-10-09 13:07 ` Tejun Heo
2017-10-09 9:40 ` Lai Jiangshan
2017-10-09 12:40 ` Boqun Feng
2017-10-09 15:24 ` Peter Zijlstra
2017-10-09 15:29 ` Tejun Heo
2017-10-09 13:21 ` [PATCH workqueue/for-4.14-fixes] workqueue: replace pool->manager_arb mutex with a flag Tejun Heo
2017-10-09 14:21 ` Boqun Feng
2017-10-09 14:47 ` Tejun Heo [this message]
2017-10-09 15:02 ` Lai Jiangshan
2017-10-09 15:08 ` Tejun Heo
2017-10-09 15:14 ` Lai Jiangshan
2017-10-09 15:33 ` Tejun Heo
2017-10-09 15:04 ` [PATCH v2 " Tejun Heo
2017-10-10 9:55 ` Lai Jiangshan
2017-10-10 14:15 ` 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=20171009144702.GB3301751@devbig577.frc2.facebook.com \
--to=tj@kernel.org \
--cc=boqun.feng@gmail.com \
--cc=jiangshanlai@gmail.com \
--cc=josef@toxicpanda.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.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