For dax we know that user space will define the policy.
Actually this may not always be true. A driver spawning a dax on probe
might also end up selecting the policy... eventually... maybe... I might
be planning to add that glue between CXL and DAX so I can add some
config similar to the system-default policy to avoid systems with
multiple memory-devices being forced into the same policy
(e.g. CXL memory device can online auto in ZONE_MOVABLE, but the other
device can have its own policy).
There's a weird corner case for CXL auto-regions (BIOS configured
everything but left the memory EFI_MEMORY_SP - so comes up as DAX).
I'm trying to keep those systems working the same as they have been
while the userland policy stuff catches up. Early CXL patterns are :[
Right, but I don't want any other OOT kernel module to be able to make
use of add_memory_driver_managed() to do arbitrary things, because we
don't know if it's really user space setting the policy for that memory
then.
So either restrict add_memory_driver_managed() to kmem+virtio_mem
completely, or add another variant that will be kmem-only (or however
that dax/cxl module is called).
--
Cheers
David