From: Tejun Heo <tj@kernel.org>
To: Jinhui Guo <guojinhui.liam@bytedance.com>
Cc: bhelgaas@google.com, bvanassche@acm.org,
dan.j.williams@intel.com, alexander.h.duyck@linux.intel.com,
gregkh@linuxfoundation.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] PCI: Avoid work_on_cpu() in async probe workers
Date: Mon, 29 Dec 2025 08:08:57 -1000 [thread overview]
Message-ID: <aVLDuUAHw0egvFfr@slm.duckdns.org> (raw)
In-Reply-To: <20251227113326.964-1-guojinhui.liam@bytedance.com>
On Sat, Dec 27, 2025 at 07:33:26PM +0800, Jinhui Guo wrote:
> To fix the issue, pci_call_probe() must not call work_on_cpu() when it is
> already running inside an unbounded asynchronous worker. Because a driver
> can be probed asynchronously either by probe_type or by the kernel command
> line, we cannot rely on PROBE_PREFER_ASYNCHRONOUS alone. Instead, we test
> the PF_WQ_WORKER flag in current->flags; if it is set, pci_call_probe() is
> executing within an unbounded workqueue worker and should skip the extra
> work_on_cpu() call.
Why not just use queue_work_on() on system_dfl_wq (or any other unbound
workqueue)? Those are soft-affine to cache domain but can overflow to other
CPUs?
Thanks.
--
tejun
next prev parent reply other threads:[~2025-12-29 18:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-27 11:33 [PATCH] PCI: Avoid work_on_cpu() in async probe workers Jinhui Guo
2025-12-29 17:20 ` Bjorn Helgaas
2025-12-29 18:08 ` Tejun Heo [this message]
2025-12-30 14:27 ` Jinhui Guo
2025-12-30 14:44 ` Jinhui Guo
2025-12-30 21:52 ` Bjorn Helgaas
2025-12-31 7:51 ` Jinhui Guo
2025-12-31 16:55 ` Bjorn Helgaas
2026-01-04 16:01 ` Danilo Krummrich
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=aVLDuUAHw0egvFfr@slm.duckdns.org \
--to=tj@kernel.org \
--cc=alexander.h.duyck@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=bvanassche@acm.org \
--cc=dan.j.williams@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=guojinhui.liam@bytedance.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--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