Gregory Price wrote: > There is no way for drivers leveraging dax_kmem to plumb through a > preferred auto-online policy - the system default policy is forced. > > Add 'enum mmop' field to DAX device creation path to allow drivers > to specify an auto-online policy when using the kmem driver. > > Capturing the system default would otherwise break the ABI, because > the system default can change - but we would be statically assigning > the value at device creation time. > > To resolve this we add DAX_ONLINE_DEFAULT, which defaults devices to > the current behavior, while providing a clean way to override it. > > No behavioural change for existing callers (still the system default).
So I know you have some future usage for this ability, but it is not present in this set. The only piece that *is* used is that the online-type from the new sysfs interface gets plumbed through to __add_memory_driver_managed(). Are these touches: > drivers/dax/cxl.c | 1 + > drivers/dax/hmem/hmem.c | 1 + > drivers/dax/pmem.c | 1 + ...premature until the first user arrives that with the background story about how it knows to set the policy? If DAX_ONLINE_DEFAULT is a sentinel for "default" should DAX_KMEM_UNPLUGGED be a different sentinel than (-1)? Feel free to add: Reviewed-by: Dan Williams <[email protected]> ...to this and the previous patches when that is fixed up.

