From: "Danilo Krummrich" <dakr@kernel.org>
To: "Bjorn Helgaas" <helgaas@kernel.org>
Cc: "Jinhui Guo" <guojinhui.liam@bytedance.com>,
<alexander.h.duyck@linux.intel.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Bart Van Assche" <bvanassche@acm.org>,
"Dan Williams" <dan.j.williams@intel.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
<linux-kernel@vger.kernel.org>, <linux-pci@vger.kernel.org>,
<stable@vger.kernel.org>, "Tejun Heo" <tj@kernel.org>,
"Alexander Duyck" <alexanderduyck@fb.com>,
"Rafael J. Wysocki" <rafael@kernel.org>
Subject: Re: [PATCH] PCI: Avoid work_on_cpu() in async probe workers
Date: Sun, 04 Jan 2026 17:01:50 +0100 [thread overview]
Message-ID: <DFFXIZR1AGTV.2WZ1G2JAU0HFQ@kernel.org> (raw)
In-Reply-To: <20251231165503.GA159243@bhelgaas>
On Wed Dec 31, 2025 at 5:55 PM CET, Bjorn Helgaas wrote:
> On Wed, Dec 31, 2025 at 03:51:05PM +0800, Jinhui Guo wrote:
>> Hi, Bjorn
>>
>> Thank you for your time and kind reply.
>>
>> As I see it, two scenarios should be borne in mind:
>>
>> 1. Driver allowed to probe asynchronously
>> The driver core schedules async workers via async_schedule_dev(),
>> so pci_call_probe() needs no extra queue_work_node().
>>
>> 2. Driver not allowed to probe asynchronously
>> The driver core (__driver_attach() or __device_attach()) calls
>> pci_call_probe() directly, without any async worker from
>> async_schedule_dev(). NUMA-node awareness in pci_call_probe()
>> is therefore still required.
>
> Good point, we need the NUMA awareness in both sync and async probe
> paths.
>
> But node affinity is orthogonal to the sync/async question, so it
> seems weird to deal with affinity in two separate places.
In general I agree, but implementation wise it might make a difference:
In the async path we ultimately use queue_work_node(), which may fall back to
default queue_work() behavior or explicitly picks the current CPU to queue work,
if we are on the corresponding NUMA node already.
In the sync path however - if we want to do something about NUMA affinity - we
probably want to queue work as well and wait for completion, but in the fallback
case always execute the code ourselves, i.e. do not queue any work at all.
> It also
> seems sub-optimal to have node affinity in the driver core async path
> but not the synchronous probe path.
>
> Maybe driver_probe_device() should do something about NUMA affinity?
driver_probe_device() might not be the best place, as it is the helper executed
from within the async path (work queue) and sync path (unless you have something
else in mind than what I mentioned above).
I think __device_attach() and __driver_attach() - probably through a common
helper - should handle NUMA affinity instead.
prev parent reply other threads:[~2026-01-04 16:01 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
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 [this message]
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=DFFXIZR1AGTV.2WZ1G2JAU0HFQ@kernel.org \
--to=dakr@kernel.org \
--cc=alexander.h.duyck@linux.intel.com \
--cc=alexanderduyck@fb.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=helgaas@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tj@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