public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: "Danilo Krummrich" <dakr@kernel.org>
To: "Jinhui Guo" <guojinhui.liam@bytedance.com>
Cc: <alexander.h.duyck@linux.intel.com>, <alexanderduyck@fb.com>,
	<bhelgaas@google.com>, <bvanassche@acm.org>,
	<dan.j.williams@intel.com>, <gregkh@linuxfoundation.org>,
	<helgaas@kernel.org>, <rafael@kernel.org>, <tj@kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-pci@vger.kernel.org>
Subject: Re: [PATCH 2/3] driver core: Add NUMA-node awareness to the synchronous probe path
Date: Sat, 17 Jan 2026 15:03:08 +0100	[thread overview]
Message-ID: <DFQX56VQ3FAV.3LIDGP9F41X1U@kernel.org> (raw)
In-Reply-To: <20260107175548.1792-3-guojinhui.liam@bytedance.com>

On Wed Jan 7, 2026 at 6:55 PM CET, Jinhui Guo wrote:
> @@ -808,6 +894,8 @@ static int __driver_probe_device(const struct device_driver *drv, struct device
>  	return ret;
>  }
>  
> +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;
>  }
>  
> +DEFINE_NUMA_WRAPPER(driver_probe_device, const struct device_driver *, struct device *)
> +
>  static inline bool cmdline_requested_async_probing(const char *drv_name)
>  {
>  	bool async_drv;
> @@ -1000,6 +1090,8 @@ static int __device_attach_driver_scan(struct device_attach_data *data,
>  	return ret;
>  }
>  
> +DEFINE_NUMA_WRAPPER(__device_attach_driver_scan, struct device_attach_data *, bool *)

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().


__device_attach_driver_scan() already has this information (i.e. we can check if
need_async == NULL). Additionally, we can change the signature of
driver_probe_device() to

	static int driver_probe_device(const struct device_driver *drv, struct device *dev, bool async)

This reduces complexity a lot, since it gets us rid of DEFINE_NUMA_WRAPPER() and
EXEC_ON_NUMA_NODE() macros.

>  static void __device_attach_async_helper(void *_dev, async_cookie_t cookie)
>  {
>  	struct device *dev = _dev;
> @@ -1055,7 +1147,9 @@ static int __device_attach(struct device *dev, bool allow_async)
>  			.want_async = false,
>  		};
>  
> -		ret = __device_attach_driver_scan(&data, &async);
> +		ret = EXEC_ON_NUMA_NODE(dev_to_node(dev),
> +					__device_attach_driver_scan,
> +					&data, &async);
>  	}
>  out_unlock:
>  	device_unlock(dev);
> @@ -1142,7 +1236,9 @@ int device_driver_attach(const struct device_driver *drv, struct device *dev)
>  	int ret;
>  
>  	__device_driver_lock(dev, dev->parent);
> -	ret = __driver_probe_device(drv, dev);
> +	ret = EXEC_ON_NUMA_NODE(dev_to_node(dev),
> +				__driver_probe_device,
> +				drv, dev);
>  	__device_driver_unlock(dev, dev->parent);
>  
>  	/* also return probe errors as normal negative errnos */
> @@ -1231,7 +1327,9 @@ static int __driver_attach(struct device *dev, void *data)
>  	}
>  
>  	__device_driver_lock(dev, dev->parent);
> -	driver_probe_device(drv, dev);
> +	EXEC_ON_NUMA_NODE(dev_to_node(dev),
> +			  driver_probe_device,
> +			  drv, dev);
>  	__device_driver_unlock(dev, dev->parent);
>  
>  	return 0;
> -- 
> 2.20.1


  parent reply	other threads:[~2026-01-17 14:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-07 17:55 [PATCH 0/3] Add NUMA-node-aware synchronous probing to driver core Jinhui Guo
2026-01-07 17:55 ` [PATCH 1/3] driver core: Introduce helper function __device_attach_driver_scan() Jinhui Guo
2026-01-17 13:36   ` Danilo Krummrich
2026-01-07 17:55 ` [PATCH 2/3] driver core: Add NUMA-node awareness to the synchronous probe path Jinhui Guo
2026-01-07 18:22   ` Danilo Krummrich
2026-01-08  8:28     ` Jinhui Guo
2026-01-17 14:03   ` Danilo Krummrich [this message]
2026-01-20 17:23     ` Jinhui Guo
2026-01-07 17:55 ` [PATCH 3/3] PCI: Clean up NUMA-node awareness in pci_bus_type probe Jinhui Guo

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=DFQX56VQ3FAV.3LIDGP9F41X1U@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=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