dax: add PROBE_PREFER_ASYNCHRONOUS to all dax drivers
PATCH v2 1/1 dax: add PROBE_PREFER_ASYNCHRONOUS to all dax drivers
Comments in linux/device/driver.h say that the goal is to do async probing on all devices. The current behavior unnecessarily slows down the boot by synchronously probing dax devices, so let's change that.
For thousands of devices, this change saves >1s of boot time.
Signed-off-by Michal Clapinski <[email protected]>
--- drivers/dax/cxl.c | 1 + drivers/dax/device.c | 3 +++ drivers/dax/hmem/hmem.c | 2 ++ drivers/dax/kmem.c | 3 +++ drivers/dax/pmem.c | 1 + 5 files changed, 10 insertions(+)
drivers/dax/cxl.c +1 -0
@@ -38,6 +38,7 @@ static struct cxl_driver cxl_dax_region_driver = { .id = CXL_DEVICE_DAX_REGION, .drv = { .suppress_bind_attrs = true, + .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, };
drivers/dax/device.c +3 -0
@@ -470,6 +470,9 @@ static int dev_dax_probe(struct dev_dax *dev_dax)static struct dax_device_driver device_dax_driver = { .probe = dev_dax_probe, .type =DAXDRV_DEVICE_TYPE , + .drv = { + .probe_type =PROBE_PREFER_ASYNCHRONOUS , + }, };static int __init dax_init (void )
drivers/dax/hmem/hmem.c +2 -0
@@ -45,6 +45,7 @@ static struct platform_driver dax_hmem_driver = { .probe = dax_hmem_probe, .driver = { .name = "hmem", + .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, };
@@ -131,6 +132,7 @@ static struct platform_driver dax_hmem_platform_driver = { .probe = dax_hmem_platform_probe, .driver = { .name = "hmem_platform", + .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, };
drivers/dax/kmem.c +3 -0
@@ -274,6 +274,9 @@ static struct dax_device_driver device_dax_kmem_driver = { .probe = dev_dax_kmem_probe, .remove = dev_dax_kmem_remove, .type = DAXDRV_KMEM_TYPE, + .drv = { + .probe_type = PROBE_PREFER_ASYNCHRONOUS, + }, };static int __init dax_kmem_init (void )
drivers/dax/pmem.c +1 -0
@@ -77,6 +77,7 @@ static struct nd_device_driver dax_pmem_driver = { .probe = dax_pmem_probe, .drv = { .name = "dax_pmem", + .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, .type = ND_DRIVER_DAX_PMEM, };
Signature · 1 line
2.51.1.821.gb6fe4d2222-goog
Quoted 5 lines · Michal Clapinski
Comments in
linux/device/driver.hsay that the goal is to do async probing on all devices. The current behavior unnecessarily slows down the boot by synchronously probing dax devices, so let's change that.For thousands of devices, this change saves >1s of boot time.
Please split this into 5 patches just so each can cause independent / bisectable regressions, but other than that you can add:
Reviewed-by Dan Williams <[email protected]>