From 496a4cd6585cabddf56b98ac01f4d4f122ecfa7b Mon Sep 17 00:00:00 2001 From: Gregory Price Date: Sun, 12 Jul 2026 11:45:01 -0400 Subject: [PATCH] dax/kmem: resolve default online type at probe time Resolve the default online type in kmem at probe time explicitly instead of implicitly inheriting the system default by calling add_memory_driver_managed(). No behavioral change at this point (still system default). Link: https://lore.kernel.org/20260712154505.3564379-8-gourry@gourry.net Signed-off-by: Gregory Price Cc: Alison Schofield Cc: Danilo Krummrich Cc: Dave Jiang Cc: David Hildenbrand (Arm) Cc: Greg Kroah-Hartman Cc: Hannes Reinecke Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Oscar Salvador Cc: Pankaj Gupta Cc: "Rafael J. Wysocki" Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vishal Verma Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- drivers/dax/kmem.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/dax/kmem.c b/drivers/dax/kmem.c index 592171ec10f4..38ed5c4e9c83 100644 --- a/drivers/dax/kmem.c +++ b/drivers/dax/kmem.c @@ -73,6 +73,7 @@ static int dev_dax_kmem_probe(struct dev_dax *dev_dax) mhp_t mhp_flags; int numa_node; int adist = MEMTIER_DEFAULT_DAX_ADISTANCE; + int online_type = mhp_get_default_online_type(); /* * Ensure good NUMA information for the persistent memory. @@ -172,8 +173,9 @@ static int dev_dax_kmem_probe(struct dev_dax *dev_dax) * Ensure that future kexec'd kernels will not treat * this as RAM automatically. */ - rc = add_memory_driver_managed(data->mgid, range.start, - range_len(&range), kmem_name, mhp_flags); + rc = __add_memory_driver_managed(data->mgid, range.start, + range_len(&range), kmem_name, mhp_flags, + online_type); if (rc) { dev_warn(dev, "mapping%d: %#llx-%#llx memory add failed\n",