From: sashiko-bot@kernel.org
To: "Gregory Price" <gourry@gourry.net>
Cc: linux-cxl@vger.kernel.org
Subject: Re: [PATCH v4 9/9] selftests/dax: add dax/kmem hotplug sysfs regression test
Date: Fri, 05 Jun 2026 21:34:30 +0000 [thread overview]
Message-ID: <20260605213430.D5CBC1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260605211911.2160954-10-gourry@gourry.net>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Skipped unplug test causes a cascading spurious failure in the subsequent `online_kernel` test.
- [Medium] The test script modifies system-wide DAX device hotplug state but lacks a `trap` to ensure restoration on unexpected termination.
--
commit eaf4726251fa25a05d2dfac099a7956bef58a48a
Author: Gregory Price <gourry@gourry.net>
selftests/dax: add dax/kmem hotplug sysfs regression test
This commit adds a kselftest to validate the whole-device hotplug sysfs
attribute for dax/kmem devices. It verifies transitions between unplugged,
online, and online_movable states, ensuring memory is properly added and
removed.
> diff --git a/tools/testing/selftests/dax/dax-kmem-hotplug.sh b/tools/testing/selftests/dax/dax-kmem-hotplug.sh
> new file mode 100755
> index 0000000000000..e43cda8ba1274
> --- /dev/null
> +++ b/tools/testing/selftests/dax/dax-kmem-hotplug.sh
[ ... ]
> +DAX=$(find_kmem_dax)
> +if [ -z "$DAX" ]; then
> + ktap_skip_all "no kmem-bound dax device with a hotplug attribute"
> + exit "$KSFT_SKIP"
> +fi
> +HP=$DAX_BASE/$DAX/hotplug
> +ORIG=$(get_state)
[Severity: Medium]
Does this script ensure the original state is restored if execution is
aborted early?
Since the original state is recorded here but no shell trap is established,
an unexpected exit or user interrupt could bypass the manual restoration
at the end of the script. Would adding an exit trap handler right after
recording the state ensure reliable cleanup?
[ ... ]
> +# The online -> unplug -> online_movable -> unplug cycle once regressed: a
> +# re-online failed to re-reserve the per-range resources, so this final unplug
> +# reported success while leaving the memory online. Assert it is really freed.
> +set_state unplugged; rc=$?
> +mt=$(memtotal_kb)
> +if [ "$rc" != 0 ]; then
> + ktap_test_skip "unplug from movable not accepted (memory in use?) rc=$rc"
> +elif [ "$(get_state)" = unplugged ] && [ "$mt" -lt "$mt_mov" ]; then
> + ktap_test_pass "unplug from online_movable removed memory: $mt_mov -> $mt kB"
> +else
> + ktap_test_fail "unplug success but memory remained: $(get_state) $mt_mov -> $mt kB"
> +fi
> +
> +set_state online_kernel; rc=$?
[Severity: Medium]
If the preceding unplug transition fails and execution enters the skip
branch, will this subsequent state transition fail spuriously?
Because the driver rejects direct transitions between different online states
without an intervening unplug, falling through to the online_kernel test
while the device is still in the online_movable state seems like it will
unconditionally fail instead of safely skipping the rest of the checks.
> +mt=$(memtotal_kb)
> +if [ "$rc" = 0 ] && [ "$(get_state)" = online_kernel ] && [ "$mt" -gt "$mt_unplugged" ]; then
> + ktap_test_pass "online_kernel: MemTotal $mt_unplugged -> $mt kB"
> +else
> + ktap_test_fail "online_kernel: rc=$rc state=$(get_state) MemTotal=$mt"
> +fi
> +set_state unplugged
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260605211911.2160954-1-gourry@gourry.net?part=9
prev parent reply other threads:[~2026-06-05 21:34 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-05 21:19 [PATCH v4 0/9] dax/kmem: atomic whole-device hotplug via sysfs Gregory Price
2026-06-05 21:19 ` [PATCH v4 1/9] mm/memory: add memory_block_aligned_range() helper Gregory Price
2026-06-09 9:50 ` David Hildenbrand (Arm)
2026-06-05 21:19 ` [PATCH v4 2/9] mm/memory_hotplug: pass online_type to online_memory_block() via arg Gregory Price
2026-06-05 21:19 ` [PATCH v4 3/9] mm/memory_hotplug: export mhp_get_default_online_type Gregory Price
2026-06-05 21:29 ` sashiko-bot
2026-06-05 21:43 ` Gregory Price
2026-06-09 9:52 ` David Hildenbrand (Arm)
2026-06-09 15:11 ` Gregory Price
2026-06-05 21:19 ` [PATCH v4 4/9] mm/memory_hotplug: add __add_memory_driver_managed() with online_type arg Gregory Price
2026-06-09 9:55 ` David Hildenbrand (Arm)
2026-06-09 15:12 ` Gregory Price
2026-06-05 21:19 ` [PATCH v4 5/9] mm/memory_hotplug: add multi-range hotunplug Gregory Price
2026-06-05 21:30 ` sashiko-bot
2026-06-09 10:06 ` David Hildenbrand (Arm)
2026-06-09 15:15 ` Gregory Price
2026-06-05 21:19 ` [PATCH v4 6/9] dax: plumb hotplug online_type through dax Gregory Price
2026-06-05 21:31 ` sashiko-bot
2026-06-05 21:54 ` Gregory Price
2026-06-09 10:21 ` David Hildenbrand (Arm)
2026-06-09 15:33 ` Gregory Price
2026-06-05 21:19 ` [PATCH v4 7/9] dax/kmem: extract hotplug/hotremove helper functions Gregory Price
2026-06-05 21:36 ` sashiko-bot
2026-06-05 22:03 ` Gregory Price
2026-06-05 21:19 ` [PATCH v4 8/9] dax/kmem: add sysfs interface for atomic hotplug Gregory Price
2026-06-05 21:37 ` sashiko-bot
2026-06-09 10:26 ` David Hildenbrand (Arm)
2026-06-09 15:35 ` Gregory Price
2026-06-09 18:11 ` David Hildenbrand (Arm)
2026-06-09 18:19 ` Gregory Price
2026-06-09 18:22 ` David Hildenbrand (Arm)
2026-06-09 18:33 ` Gregory Price
2026-06-05 21:19 ` [PATCH v4 9/9] selftests/dax: add dax/kmem hotplug sysfs regression test Gregory Price
2026-06-05 21:34 ` sashiko-bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260605213430.D5CBC1F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=gourry@gourry.net \
--cc=linux-cxl@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.