From: Alison Schofield <alison.schofield@intel.com>
To: "Gregory Price (Meta)" <gourry@gourry.net>
Cc: <nvdimm@lists.linux.dev>, <linux-cxl@vger.kernel.org>
Subject: Re: [PATCH 0/6] daxctl: use dax kmem atomic whole-device hotplug
Date: Wed, 21 Oct 2026 18:59:45 -0700 [thread overview]
Message-ID: <atluEdaffcWYOf_0@aschofie-mobl2.lan> (raw)
In-Reply-To: <20261016214248.443247-1-gourry@gourry.net>
On Fri, Oct 16, 2026 at 05:42:42PM -0400, Gregory Price (Meta) wrote:
> Kernels with the dax_kmem daxX.Y/state attribute [1] can unplug or
> plug-and-online a whole device atomically. Use it in daxctl
> online-memory and offline-memory so other agents (udev, auto-online)
> can't race daxctl block by block, notably the offline-then-unbind race
> on teardown.
>
> Kernels without the attribute keep the per-block path.
>
> Behavior change: offline-memory now always unplugs the device (state
> 'unplugged'), removing its memory blocks, even if they were all
> offline already. Previously that was a no-op.
>
> 'daxctl list' (and 'ndctl/cxl list -X') gains 'hotplug_state',
> reporting daxX.Y/state. The kernel only updates that when written, so
> it goes stale if blocks are toggled individually.
>
> If there is a mismatch between 'dax/state' and the blocks, then
> 'hotplug_state' reports 'inconsistent' (online state / zones disagree).
> That is intentional: it flags agents fighting over the device.
> It only appears when the attribute exists.
>
> Compatibility notes:
> - Where the unplug fails (e.g. no memory hotremove support),
> online-memory falls back to the per-block path and offline-memory
> of an already offline device remains a no-op.
> - Older daxctl/ndctl/cxl binaries don't expect a device with no memory
> blocks. Basically multiple daxctl versions on the same box can cause
> older versions to fail when in the unplugged state. Not a huge issue.
> - If re-adding fails after an unplug (e.g. region can't be reserved)
> the device is left unplugged.
> - For multi-range devices the kernel succeeds if any range is added.
> daxctl can't tell that a range is missing.
>
> [1] https://lore.kernel.org/all/20260712154505.3564379-1-gourry@gourry.net/
Hi Greg,
Next version, please add the ndctl label, ie [ndctl PATCH v2 0/6]
(https://github.com/pmem/ndctl?tab=contributing-ov-file)
I see this goes with the kernel functionality that arrived in kernel 7.3.
That took me a bit to realized because the linked kernel series shows
crickets at v7.
I'd like to get this into the pending ndctl release, so let's see if we
can close on a few things.
I tested against 7.3, regression and new tests and all is good there.
I tested against 7.2 because daxctl command functionality itself needs to
be backward compatible, and it is!
Some per patch feedback and tags follow.
-- Alison
>
> Gregory Price (6):
> libdaxctl: add dax kmem atomic hotplug state accessors
> daxctl: online whole-device memory atomically when available
> daxctl: offline whole-device memory via atomic unplug when available
> daxctl: report whole-device hotplug state in 'daxctl list'
> Documentation: describe atomic whole-device hotplug in daxctl man
> pages
> test/daxctl-devices.sh: cycle offline/online to cover unplug and
> replug
>
> Documentation/daxctl/daxctl-list.txt | 5 +
> .../daxctl/daxctl-offline-memory.txt | 5 +
> Documentation/daxctl/daxctl-online-memory.txt | 5 +
> .../daxctl/daxctl-reconfigure-device.txt | 5 +-
> daxctl/device.c | 156 +++++++++++++++++-
> daxctl/json.c | 53 +++++-
> daxctl/lib/libdaxctl-private.h | 9 +
> daxctl/lib/libdaxctl.c | 71 +++++++-
> daxctl/lib/libdaxctl.sym | 6 +
> daxctl/libdaxctl.h | 18 ++
> test/daxctl-devices.sh | 53 ++++++
> 11 files changed, 379 insertions(+), 7 deletions(-)
>
> --
> 2.53.0-Meta
>
>
next prev parent reply other threads:[~2026-10-22 1:59 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 21:42 [PATCH 0/6] daxctl: use dax kmem atomic whole-device hotplug Gregory Price (Meta)
2026-10-16 21:42 ` [PATCH 1/6] libdaxctl: add dax kmem atomic hotplug state accessors Gregory Price (Meta)
2026-10-22 2:01 ` Alison Schofield
2026-10-16 21:42 ` [PATCH 2/6] daxctl: online whole-device memory atomically when available Gregory Price (Meta)
2026-10-22 2:12 ` Alison Schofield
2026-10-22 16:40 ` Gregory Price (Meta)
2026-10-16 21:42 ` [PATCH 3/6] daxctl: offline whole-device memory via atomic unplug " Gregory Price (Meta)
2026-10-22 2:20 ` Alison Schofield
2026-10-22 16:46 ` Gregory Price (Meta)
2026-10-22 22:00 ` Alison Schofield
2026-10-23 1:48 ` Gregory Price (Meta)
2026-10-23 1:56 ` Gregory Price (Meta)
2026-10-16 21:42 ` [PATCH 4/6] daxctl: report whole-device hotplug state in 'daxctl list' Gregory Price (Meta)
2026-10-22 2:21 ` Alison Schofield
2026-10-16 21:42 ` [PATCH 5/6] Documentation: describe atomic whole-device hotplug in daxctl man pages Gregory Price (Meta)
2026-10-22 2:23 ` Alison Schofield
2026-10-22 16:47 ` Gregory Price (Meta)
2026-10-16 21:42 ` [PATCH 6/6] test/daxctl-devices.sh: cycle offline/online to cover unplug and replug Gregory Price (Meta)
2026-10-22 2:34 ` Alison Schofield
2026-10-22 16:49 ` Gregory Price (Meta)
2026-10-22 1:59 ` Alison Schofield [this message]
2026-10-22 16:30 ` [PATCH 0/6] daxctl: use dax kmem atomic whole-device hotplug Gregory Price (Meta)
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=atluEdaffcWYOf_0@aschofie-mobl2.lan \
--to=alison.schofield@intel.com \
--cc=gourry@gourry.net \
--cc=linux-cxl@vger.kernel.org \
--cc=nvdimm@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox