aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/base.h
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@linux.intel.com>2019-01-22 10:39:21 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-31 14:20:53 +0100
commitef0ff68351be4fd83bec2d797f0efdc0174a55a4 (patch)
tree55368b22a14e108f416a7f846560065f92fbc4e1 /drivers/base/base.h
parentdevice core: Consolidate locking and unlocking of parent and device (diff)
downloadlinux-dev-ef0ff68351be4fd83bec2d797f0efdc0174a55a4.tar.xz
linux-dev-ef0ff68351be4fd83bec2d797f0efdc0174a55a4.zip
driver core: Probe devices asynchronously instead of the driver
Probe devices asynchronously instead of the driver. This results in us seeing the same behavior if the device is registered before the driver or after. This way we can avoid serializing the initialization should the driver not be loaded until after the devices have already been added. The motivation behind this is that if we have a set of devices that take a significant amount of time to load we can greatly reduce the time to load by processing them in parallel instead of one at a time. In addition, each device can exist on a different node so placing a single thread on one CPU to initialize all of the devices for a given driver can result in poor performance on a system with multiple nodes. This approach can reduce the time needed to scan SCSI LUNs significantly. The only way to realize that speedup is by enabling more concurrency which is what is achieved with this patch. To achieve this it was necessary to add a new member "async_driver" to the device_private structure to store the driver pointer while we wait on the deferred probe call. Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com> Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/base.h')
-rw-r--r--drivers/base/base.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/base/base.h b/drivers/base/base.h
index b6966511b0ca..b405436ee28e 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -65,6 +65,7 @@ struct driver_private {
* binding of drivers which were unable to get all the resources needed by
* the device; typically because it depends on another driver getting
* probed first.
+ * @async_driver - pointer to device driver awaiting probe via async_probe
* @device - pointer back to the struct device that this structure is
* associated with.
* @dead - This device is currently either in the process of or has been
@@ -80,6 +81,7 @@ struct device_private {
struct klist_node knode_bus;
struct klist_node knode_class;
struct list_head deferred_probe;
+ struct device_driver *async_driver;
struct device *device;
u8 dead:1;
};