summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Price <gourry@gourry.net>2026-07-12 11:45:01 -0400
committerAndrew Morton <akpm@linux-foundation.org>2026-08-06 18:57:00 -0700
commit496a4cd6585cabddf56b98ac01f4d4f122ecfa7b (patch)
treea475cb90d381dc5d8b2900c03addf736ee92727f
parentc17ba40c37e890987dce846cf6e1ec6a2bf79ea3 (diff)
downloadlinux-496a4cd6585cabddf56b98ac01f4d4f122ecfa7b.tar.gz
linux-496a4cd6585cabddf56b98ac01f4d4f122ecfa7b.zip
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 <gourry@gourry.net> Cc: Alison Schofield <alison.schofield@intel.com> Cc: Danilo Krummrich <dakr@kernel.org> Cc: Dave Jiang <dave.jiang@intel.com> Cc: David Hildenbrand (Arm) <david@kernel.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Hannes Reinecke <hare@suse.de> Cc: Liam R. Howlett <liam@infradead.org> Cc: Lorenzo Stoakes <ljs@kernel.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Mike Rapoport <rppt@kernel.org> Cc: Oscar Salvador <osalvador@suse.de> Cc: Pankaj Gupta <pankaj.gupta@amd.com> Cc: "Rafael J. Wysocki" <rafael@kernel.org> Cc: Shuah Khan <shuah@kernel.org> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Vishal Verma <vishal.l.verma@intel.com> Cc: Vlastimil Babka <vbabka@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r--drivers/dax/kmem.c6
1 files 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",