This series adds uapi bits for private memory NUMA node [0] control.
It is not intended for merge - just discussion.
I have been using this to extensively test mm/ behaviors with private
nodes [1] and am wondering whether some of this is more generally
useful for coherent memory devices if private nodes lands.
For now, this is useful for testing, but locks in UAPI, so this RFC
is not intended as an intent to upstream - just sharing my testing api.
Question 1: Do we want dax control of private node settings?
1a) External? (uapi like this?)
1b) Internal-only? (plumbed through module apis)
Question 2: If we do want this, do we want it in kmem or a
separate dax driver? (dax/private_mem ?)
Question 3: are dax_file and adistance useful regardless?
This adds 9 interfaces:
dax0.0/dax_file
this makes /dev/dax0.0 mmap-able when online as kmem
it essentially attaches a default mempolicy to the vma
that binds it to the dax device's node.
dax0.0/private
this switches whether hotplug sets N_MEMORY or N_MEMORY_PRIVATE
dax0.0/adistance
this allows overriding the default adistance to for the node
into a specific tier. That allows for testing tiering in both
directions (demotion from/to the node)
dax0.0/reclaim
dax0.0/user_numa
dax0.0/hotunplug
dax0.0/demotion
dax0.0/numa_balancing
dax0.0/ltpin
these bits all enable their respective NODE_PRIVATE_CAP_ bit
reclaim - enables reclaim on the node
user_numa - enables mbind/mempolicy/move_pages/migrate_pages
hotunplug - enables hotunplug to migrate memory
demotion - enables reclaim to demote from or to the node
numa_balancing - allows prot_none injection on the node's folios
ltpin - allows longterm pin on node's folios to work
[0] private node series
https://lore.kernel.org/linux-mm/[email protected]/
[1] selftests/dax extensions for all of this that show use cases and
testing for the private node series - including all user api's
like mbind, set_mempolicy, move_pages, migrate_privates - as well
as reclaim behaviors.
https://github.com/gourryinverse/linux/commits/scratch/gourry/managed_nodes/dax_private-mm-new/
Gregory Price (8):
dax/kmem: add dax_file= to expose an anonymous-fault char device
dax/kmem: add private= to online memory as an N_MEMORY_PRIVATE node
dax/kmem: add the reclaim opt-in (CAP_RECLAIM) for private nodes
dax/kmem: add the user_numa opt-in (CAP_USER_NUMA) for private nodes
dax/kmem: add the hotunplug opt-in (CAP_HOTUNPLUG) for private nodes
dax/kmem: add the demotion and numa_balancing opt-ins for private
nodes
dax/kmem: add the ltpin opt-in (CAP_LTPIN) for private nodes
dax/kmem: add dax/adistance to make private node adistance
configurable
drivers/dax/kmem.c | 368 ++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 366 insertions(+), 2 deletions(-)
--
2.53.0-Meta