From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sg-1-100.ptr.blmpb.com (sg-1-100.ptr.blmpb.com [118.26.132.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 01A2634AB16 for ; Tue, 20 Jan 2026 17:23:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=118.26.132.100 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768929826; cv=none; b=bPjiSctKMqQ/qYVnQ7KiXXX0RF67F0Cq0rzfxTrFqtHPpTmSX1WkE/ThYPpVVQIUfG4tOG2BAyXEHA81d4qfjiJj2dqp7kSeWqdHQX+8IypN7hsNAbYBBWVzKuolEfG6/VYsDJrbl6TtEHE8kz+trQAm02gfET9b4XA6Niodv4o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768929826; c=relaxed/simple; bh=SdjSdHKvO8THi45dn6X9NdTRCSJx540D5Bt52gH7aYo=; h=Message-Id:References:Cc:Subject:Date:Mime-Version:Content-Type: In-Reply-To:To:From; b=RcvHYUkd3kPP0m70Cbwvf4s87KaFaCpFLc6UPbzb2JDEAjHHV1NTyNJo70wjkF4fDJa6EPShCZyxipZ9RfJCEXjR+/vL2ubU30zROb/Adl3oG90Kv9CaWRZ0BrJ6KvHE3KBGoW0m7RQwfWYYUj2GMsBQjQeM56NDzppf6m12PnI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=AO20+pe8; arc=none smtp.client-ip=118.26.132.100 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="AO20+pe8" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=2212171451; d=bytedance.com; t=1768929812; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=xqgOwEl7H5W1IO6M3fF4IcIp7BnqHPSKNoy+L7rxJ/M=; b=AO20+pe8JZl0NqRaT1dv6yCsbb6LYmQ6qZfsbeBmhr6iDiti4plA9dh3i1+RWz0MoCpSIF p0DPC9ItguLHHaCNAxPGbHSYP7BZEqY5Mqdx1gT9W6q14DIgq8Z/3PxMHHPisCahFNfcwF e/tXXAkHPT1FuGt9f8KwXgn7cRNoHTU1Wa/bcIxQlGgU0BdqEVNV+EVJUyua7kGS0nMlZ9 p/JVa5huAX8ON2yoKrzsCFKRF4S5VomTxYYnfqhff704ywsRgSqVMBPe9eGwGsKIPwL5fy tFbyjt2wsJLFtLP1qnB8iRbUeFjtEEkEfYHmKaPIrFq1mdxmo/F+Q2AxBwpDHA== Message-Id: <20260120172316.652-1-guojinhui.liam@bytedance.com> References: X-Original-From: Jinhui Guo Cc: , , , , , , , , , , , Subject: Re: [PATCH 2/3] driver core: Add NUMA-node awareness to the synchronous probe path Date: Wed, 21 Jan 2026 01:23:16 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Mailer: git-send-email 2.17.1 In-Reply-To: Content-Transfer-Encoding: quoted-printable To: From: "Jinhui Guo" X-Lms-Return-Path: On Sat Jan 17, 2026 15:03:08 +0100, Danilo Krummrich wrote: > On Wed Jan 7, 2026 at 6:55 PM CET, Jinhui Guo wrote: > > @@ -808,6 +894,8 @@ static int __driver_probe_device(const struct devic= e_driver *drv, struct device > > return ret; > > } > > =20 > > +DEFINE_NUMA_WRAPPER(__driver_probe_device, const struct device_driver = *, struct device *) > > + > > /** > > * driver_probe_device - attempt to bind device & driver together > > * @drv: driver to bind a device to > > @@ -844,6 +932,8 @@ static int driver_probe_device(const struct device_= driver *drv, struct device *d > > return ret; > > } > > =20 > > +DEFINE_NUMA_WRAPPER(driver_probe_device, const struct device_driver *,= struct device *) > > + > > static inline bool cmdline_requested_async_probing(const char *drv_nam= e) > > { > > bool async_drv; > > @@ -1000,6 +1090,8 @@ static int __device_attach_driver_scan(struct dev= ice_attach_data *data, > > return ret; > > } > > =20 > > +DEFINE_NUMA_WRAPPER(__device_attach_driver_scan, struct device_attach_= data *, bool *) >=20 > Why define three different wrappers? To me it looks like we should easily= get > away with a single wrapper for __driver_probe_device(), which could just = be > __driver_probe_device_node(). >=20 >=20 > __device_attach_driver_scan() already has this information (i.e. we can c= heck if > need_async =3D=3D NULL). Additionally, we can change the signature of > driver_probe_device() to >=20 > static int driver_probe_device(const struct device_driver *drv, struct d= evice *dev, bool async) >=20 > This reduces complexity a lot, since it gets us rid of DEFINE_NUMA_WRAPPE= R() and > EXEC_ON_NUMA_NODE() macros. Hi Danilo, Thank you for your time and helpful comments. Apologies for the delayed reply. I understand your concern: before sending = this patchset I prototyped a version that added __driver_probe_device_node() and relied solely on current_is_async() to detect an async worker, without chan= ging driver_probe_device()=E2=80=99s signature. That proved fragile, so I abando= ned it; your suggestion is the more reliable path forward. I=E2=80=99ve spent the last couple of days preparing a new patch and will s= end it out after testing. Best Regards, Jinhui