Skip to contentSkip to conversation

selftests-dax-add-dax-kmem-hotplug-sysfs-regression-test.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Aug 7

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: selftests/dax: add dax/kmem hotplug sysfs regression test
has been removed from the -mm tree. Its filename was
selftests-dax-add-dax-kmem-hotplug-sysfs-regression-test.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Gregory Price <[email protected]>
Subject: selftests/dax: add dax/kmem hotplug sysfs regression test
Date: Sun, 12 Jul 2026 11:45:04 -0400

Add a kselftest for the dax/kmem whole-device "state" sysfs attribute (/sys/bus/dax/devices/daxX.Y/state), which transitions a kmem-backed dax device between "unplugged", "online" and "online_movable".

The kselftest also includes a test to demonstrate the force-unbind does not deadlock - but this is destructive (the dax device can never be rebound), so it only runs when DAX_KMEM_TEST_UNBIND=1 is set.

Provisioning a devdax device and binding it to kmem needs daxctl/ndctl out of scope for an in-tree selftest. As the test mutates a device's memory, the operator opts in by naming it in DAX_KMEM_TEST_DEV (or "auto" to pick the first kmem-bound device); it SKIPs when unset, when no device is present, or when the memory cannot be freed to a baseline.

When a device is available it validates the interface contract:
- online / online_movable actually add memory (MemTotal grows),
- online is idempotent,
- switching between online types without unplug is rejected,
- unplug removes memory and the reported state is "unplugged"
- invalid input is rejected,
- unplug and unbind tolerate blocks toggled out-of-band through the per-block memoryX/state interface.

One specific regression test:

    online -> unplug -> online_movable -> unplug

Re-online must re-reserve per-range resources so subsequent unplug actually offlines and removes instead of silently reporting success while the memory stays online.

Cc Alison Schofield <[email protected]>
Cc Danilo Krummrich <[email protected]>
Cc Dave Jiang <[email protected]>
Cc David Hildenbrand (Arm) <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Hannes Reinecke <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Oscar Salvador <[email protected]>
Cc Pankaj Gupta <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Shuah Khan <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Vishal Verma <[email protected]>
Cc Vlastimil Babka <[email protected]>

---

 tools/testing/selftests/Makefile                |    1 
 tools/testing/selftests/dax/Makefile            |    6 
 tools/testing/selftests/dax/config              |    4 
 tools/testing/selftests/dax/dax-kmem-hotplug.sh |  317 ++++++++++++++
 tools/testing/selftests/dax/settings            |    1 
 5 files changed, 329 insertions(+)
tools/testing/selftests/dax/config new file +4 -0
new file mode 100644
@@ -0,0 +1,4 @@
+CONFIG_DEV_DAX=m
+CONFIG_DEV_DAX_KMEM=m
+CONFIG_MEMORY_HOTPLUG=y
+CONFIG_MEMORY_HOTREMOVE=y
tools/testing/selftests/dax/dax-kmem-hotplug.sh new file +317 -0

317 lines not on this page · raw message

tools/testing/selftests/dax/Makefile new file +6 -0
new file mode 100644
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0
+all:
+
+TEST_PROGS := dax-kmem-hotplug.sh
+
+include ../lib.mk
tools/testing/selftests/dax/settings new file +1 -0
new file mode 100644
@@ -0,0 +1 @@
+timeout=90
tools/testing/selftests/Makefile renamed from tools/testing/selftests/Makefile~selftests-dax-add-dax-kmem-hotplug-sysfs-regression-test +1 -0
@@ -14,6 +14,7 @@ TARGETS += core
 TARGETS += cpufreq
 TARGETS += cpu-hotplug
 TARGETS += damon
+TARGETS += dax
 TARGETS += devices/error_logs
 TARGETS += devices/probe
 TARGETS += dmabuf-heaps

_

Patches currently in -mm which might be from [email protected] are