dax: add PROBE_PREFER_ASYNCHRONOUS to all the dax drivers
v3 cover dax: add PROBE_PREFER_ASYNCHRONOUS to all the 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.
Michal Clapinski (5):
dax: add PROBE_PREFER_ASYNCHRONOUS to the pmem driver
dax: add PROBE_PREFER_ASYNCHRONOUS to the kmem driver
dax: add PROBE_PREFER_ASYNCHRONOUS to the cxl driver
dax: add PROBE_PREFER_ASYNCHRONOUS to the hmem drivers
dax: add PROBE_PREFER_ASYNCHRONOUS to the dax device driver
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(+)
Signature · 1 line
2.51.1.821.gb6fe4d2222-goog
PATCH v3 1/5 dax: add PROBE_PREFER_ASYNCHRONOUS to the pmem driver
--- drivers/dax/pmem.c | 1 + 1 file changed, 1 insertion(+)
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
PATCH v3 2/5 dax: add PROBE_PREFER_ASYNCHRONOUS to the kmem driver
In reply to Michal Clapinski--- drivers/dax/kmem.c | 3 +++ 1 file changed, 3 insertions(+)
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 )
Signature · 1 line
2.51.1.821.gb6fe4d2222-goog
PATCH v3 3/5 dax: add PROBE_PREFER_ASYNCHRONOUS to the cxl driver
In reply to Michal Clapinski--- drivers/dax/cxl.c | 1 + 1 file changed, 1 insertion(+)
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, }, };
Signature · 1 line
2.51.1.821.gb6fe4d2222-goog
PATCH v3 4/5 dax: add PROBE_PREFER_ASYNCHRONOUS to the hmem drivers
In reply to Michal Clapinski--- drivers/dax/hmem/hmem.c | 2 ++ 1 file changed, 2 insertions(+)
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, }, };
Signature · 1 line
2.51.1.821.gb6fe4d2222-goog
PATCH v3 5/5 dax: add PROBE_PREFER_ASYNCHRONOUS to the dax device driver
In reply to Michal Clapinski--- drivers/dax/device.c | 3 +++ 1 file changed, 3 insertions(+)
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 )
Signature · 1 line
2.51.1.821.gb6fe4d2222-goog
Re: [PATCH v3 5/5] dax: add PROBE_PREFER_ASYNCHRONOUS to the dax device driver
Quoted 2 lines · Michal Clapinski
Signed-off-by Michal Clapinski <[email protected]>Reviewed-by Dan Williams <[email protected]>
Sorry for the delay. I picked up this series but I find that this breaks the device-dax and daxctl-create.sh.
I was able to fix device-dax with a sleep, see below.
I'm not 100% sure what to do about this.
I don't want to sprinkle sleeps around the tests. daxctl-create.sh also randomly fail due to the races introduced. So not sure exactly where to sprinkle them without more work.
Could dropping just this patch and landing the others achieve most of what you need?
Ira
test/device-dax.c +1 -0
@@ -246,6 +246,7 @@ static int __test_device_dax(unsigned long align, int loglevel, goto out; } +sleep (1 );sprintf (path,"/dev/%s" ,daxctl_dev_get_devname (dev)); fd =open (path,O_RDONLY );if (fd <0 ) {
Re: [PATCH v3 5/5] dax: add PROBE_PREFER_ASYNCHRONOUS to the dax device driver
Quoted 8 lines · Ira Weiny
Quoted 2 lines · Michal Clapinski
Signed-off-by Michal Clapinski <[email protected]>Reviewed-by Dan Williams <[email protected]>Sorry for the delay. I picked up this series but I find that this breaks the device-dax and
daxctl-create.sh.
Quoted 7 lines
I was able to fix device-dax with a sleep, see below.
I'm not 100% sure what to do about this.
I don't want to sprinkle sleeps around the tests.
daxctl-create.shalso randomly fail due to the races introduced. So not sure exactly where to sprinkle them without more work.
I see 2 possible solutions here:
1. Modify the tests to just poll for the devices to appear.
2. Modify ndctl to poll for the devices to appear before returning.
What do you think about those?
Quoted 2 lines
Could dropping just this patch and landing the others achieve most of what you need?
No, device-dax is the only one I actually care about.
Re: [PATCH v3 5/5] dax: add PROBE_PREFER_ASYNCHRONOUS to the dax device driver
Quoted 17 lines · Michał Cłapiński
Quoted 8 lines · Ira Weiny
Quoted 2 lines · Michal Clapinski
Signed-off-by Michal Clapinski <[email protected]>Reviewed-by Dan Williams <[email protected]>Sorry for the delay. I picked up this series but I find that this breaks the device-dax and
daxctl-create.sh.Quoted 7 lines
I was able to fix device-dax with a sleep, see below.
I'm not 100% sure what to do about this.
I don't want to sprinkle sleeps around the tests.
daxctl-create.shalso randomly fail due to the races introduced. So not sure exactly where to sprinkle them without more work.
Quoted 5 lines
I see 2 possible solutions here:
1. Modify the tests to just poll for the devices to appear.
2. Modify ndctl to poll for the devices to appear before returning.What do you think about those?
Yes those would be correct ways fix to the tests. But I do wonder if there are any real codes which might break with this.
The real issue is the incompatibility of changing the behavior and having an older ndctl start failing either the tests or code written to libdaxctl/daxctl.
In this case I'm not seeing a good way around this other than trying to make a good documentation update to indicate that the ndctl needs to be updated for the tests at a minimum. If we get reports of failures from real users though it will need to be reverted.
Quoted 5 lines
Quoted 3 lines
Could dropping just this patch and landing the others achieve most of what you need?
No, device-dax is the only one I actually care about.
I was afraid you would say that... :-/ ;-)
I'm going to drop this patch while I coordinate with Alison on updating ndctl. If we can get a fix next week to ndctl I can throw it back in for the merge. I think it has enough testing to work that way. Otherwise it will have to land in 6.20 after ndctl is fixed up.
Ira
Quoted 4 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.
Quoted 8 lines
For thousands of devices, this change saves >1s of boot time.
Michal Clapinski (5):
dax: addPROBE_PREFER_ASYNCHRONOUSto the pmem driver
dax: addPROBE_PREFER_ASYNCHRONOUSto the kmem driver
dax: addPROBE_PREFER_ASYNCHRONOUSto the cxl driver
dax: addPROBE_PREFER_ASYNCHRONOUSto the hmem drivers
dax: addPROBE_PREFER_ASYNCHRONOUSto the dax device driver
Looks good, thanks for the split.
Quoted 13 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.
Michal Clapinski (5):
dax: addPROBE_PREFER_ASYNCHRONOUSto the pmem driver
dax: addPROBE_PREFER_ASYNCHRONOUSto the kmem driver
dax: addPROBE_PREFER_ASYNCHRONOUSto the cxl driver
dax: addPROBE_PREFER_ASYNCHRONOUSto the hmem drivers
dax: addPROBE_PREFER_ASYNCHRONOUSto the dax device driver
Quoted 7 lines
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(+)
for the series
Quoted 21 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.
Michal Clapinski (5):
dax: addPROBE_PREFER_ASYNCHRONOUSto the pmem driver
dax: addPROBE_PREFER_ASYNCHRONOUSto the kmem driver
dax: addPROBE_PREFER_ASYNCHRONOUSto the cxl driver
dax: addPROBE_PREFER_ASYNCHRONOUSto the hmem drivers
dax: addPROBE_PREFER_ASYNCHRONOUSto the dax device driverdrivers/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(+)
Quoted 3 lines
--
2.51.1.821.gb6fe4d2222-goog
+Ira (you're not listed as a maintainer of drivers/dax/ in the MAINTAINERS file)
Is there anything else required from my side or can this be merged?
Quoted 4 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.
Quoted 8 lines
For thousands of devices, this change saves >1s of boot time.
Michal Clapinski (5):
dax: addPROBE_PREFER_ASYNCHRONOUSto the pmem driver
dax: addPROBE_PREFER_ASYNCHRONOUSto the kmem driver
dax: addPROBE_PREFER_ASYNCHRONOUSto the cxl driver
dax: addPROBE_PREFER_ASYNCHRONOUSto the hmem drivers
dax: addPROBE_PREFER_ASYNCHRONOUSto the dax device driver
After seeing the trouble this causes with libdaxctl and failing to find a quick fix I wonder if you should just go through route of eating the potential regressions in your own environment.
I.e. instead of making it a problem that the kernel needs to debug for all legacy users, how about you just boot with the command line option:
driver_async_probe=device_dax
...or add the following to your mopdrobe configuration:
options device_dax async_probe
I.e. do you really need to change this policy globally for everyone at this point?
I do want to improve this, but I think it will take time for libdaxctl to get ready for this flag day.
Quoted 22 lines · On Fri, Nov 21, 2025 at 1:59 AM <[email protected]> wrote:
Quoted 4 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.Quoted 8 lines
For thousands of devices, this change saves >1s of boot time.
Michal Clapinski (5):
dax: addPROBE_PREFER_ASYNCHRONOUSto the pmem driver
dax: addPROBE_PREFER_ASYNCHRONOUSto the kmem driver
dax: addPROBE_PREFER_ASYNCHRONOUSto the cxl driver
dax: addPROBE_PREFER_ASYNCHRONOUSto the hmem drivers
dax: addPROBE_PREFER_ASYNCHRONOUSto the dax device driverAfter seeing the trouble this causes with libdaxctl and failing to find a quick fix I wonder if you should just go through route of eating the potential regressions in your own environment.
I.e. instead of making it a problem that the kernel needs to debug for all legacy users, how about you just boot with the command line option:
Quoted 8 lines
driver_async_probe=device_dax
...or add the following to your mopdrobe configuration:
options
device_daxasync_probeI.e. do you really need to change this policy globally for everyone at this point?
I'll do that or I'll just cherry-pick this to our kernel. Thank you.
Quoted 2 lines
I do want to improve this, but I think it will take time for libdaxctl to get ready for this flag day.