From: Tejun Heo <tj@kernel.org>
To: Matthew Brost <matthew.brost@intel.com>
Cc: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
Carlos Santa <carlos.santa@intel.com>,
Ryan Neph <ryanneph@google.com>,
stable@vger.kernel.org, Lai Jiangshan <jiangshanlai@gmail.com>,
Waiman Long <longman@redhat.com>
Subject: Re: [PATCH] workqueue: Add pool_workqueue to pending_pwqs list when unplugging multiple inactive works
Date: Tue, 31 Mar 2026 14:05:41 -1000 [thread overview]
Message-ID: <acxhVZK_zlv1orIX@slm.duckdns.org> (raw)
In-Reply-To: <20260331221839.1033423-1-matthew.brost@intel.com>
Hello,
On Tue, Mar 31, 2026 at 03:18:39PM -0700, Matthew Brost wrote:
> @@ -1849,8 +1849,20 @@ static void unplug_oldest_pwq(struct workqueue_struct *wq)
> raw_spin_lock_irq(&pwq->pool->lock);
> if (pwq->plugged) {
> pwq->plugged = false;
> - if (pwq_activate_first_inactive(pwq, true))
> + if (pwq_activate_first_inactive(pwq, true)) {
> + if (!list_empty(&pwq->inactive_works)) {
> + struct worker_pool *pool = pwq->pool;
> + struct wq_node_nr_active *nna =
> + wq_node_nr_active(wq, pool->node);
> +
> + raw_spin_lock(&nna->lock);
> + if (list_empty(&pwq->pending_node))
> + list_add_tail(&pwq->pending_node,
> + &nna->pending_pwqs);
> + raw_spin_unlock(&nna->lock);
> + }
It's a bit gnarly to open code locking and list operation. Would just
calling pwq_activate_first_inactive(pwq, false) one more time work here?
That'd trigger tryinc_node_nr_active() failure in pwq_tryinc_nr_active() and
the addition to the pending list. As this is quite subtle, it'd be nice to
have some comment - it's compensating for the missed pwq_tryinc_nr_active()
call due to plugging, right?
Thanks.
--
tejun
next prev parent reply other threads:[~2026-04-01 0:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-31 22:18 Matthew Brost
2026-04-01 0:05 ` Tejun Heo [this message]
2026-04-01 0:22 ` Matthew Brost
2026-04-01 0:48 ` Matthew Brost
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=acxhVZK_zlv1orIX@slm.duckdns.org \
--to=tj@kernel.org \
--cc=carlos.santa@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=matthew.brost@intel.com \
--cc=ryanneph@google.com \
--cc=stable@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®