linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Gregory Price <gourry@gourry.net>,
	linux-mm@kvack.org, vishal.l.verma@intel.com,
	dave.jiang@intel.com, akpm@linux-foundation.org,
	osalvador@suse.de
Cc: dan.j.williams@intel.com, ljs@kernel.org,
	Liam.Howlett@oracle.com, vbabka@kernel.org, rppt@kernel.org,
	surenb@google.com, mhocko@suse.com, linux-kernel@vger.kernel.org,
	nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org,
	kernel-team@meta.com
Subject: Re: [PATCH 0/8] dax/kmem: atomic whole-device hotplug via sysfs
Date: Mon, 13 Apr 2026 16:49:40 +0200	[thread overview]
Message-ID: <4c08c0a8-9415-4f30-bfa9-db39318fa7d3@kernel.org> (raw)
In-Reply-To: <20260321150404.3288786-1-gourry@gourry.net>

On 3/21/26 16:03, Gregory Price wrote:
> The dax kmem driver currently onlines memory during probe using the
> system default policy, with no way to control or query the region state
> at runtime - other than by inspecting the state of individual blocks.
> 
> Offlining and removing an entire region requires operating on individual
> memory blocks, creating race conditions where external entities can
> interfere between the offline and remove steps.
> 
> The problem was discussed specifically in the LPC2025 device memory
> sessions - https://lpc.events/event/19/contributions/2016/ - where
> it was discussed how the non-atomic interface for dax hotplug is causing
> issues in some distributions which have competing userland controllers
> that interfere with each other.
> 
> This series adds a sysfs "hotplug" attribute for atomic whole-device
> hotplug control, along with the mm and dax plumbing to support it.
> 
> The first five patches prepare the mm and dax layers:
> 
>   1. Consolidate memory-tier type deduplication into mt_get_memory_type(),
>      removing redundant per-driver infrastructure.
>   2. Add a memory_block_align_range() helper for hotplug range alignment.
>   3-5. Thread an explicit online_type through the memory hotplug and dax
>      paths, allowing drivers to specify a preferred auto-online policy
>      (ZONE_NORMAL vs ZONE_MOVABLE) instead of being forced to the
>      system default.
> 
> The last three patches build the dax/kmem feature:
> 
>   6. Plumb online_type through the dax device creation path.
>   7. Extract hotplug/hotremove into helper functions to separate resource
>      lifecycle from memory onlining.
>   8. Add the "hotplug" sysfs attribute supporting three states:
>      - "unplug": memory blocks removed
>      - "online": online as normal system RAM
>      - "online_movable": online in ZONE_MOVABLE
> 
> Transitions are atomic across all ranges in the device.  Backward
> compatibility is preserved: probe still auto-onlines when the configured
> policy matches the system default.
> 
> Specific notes for maintainers:
> 
> I downgraded a BUG() to a WARN() when unbind is called while the dax
> device is not un an UNPLUGGED state.  This is because the old pattern of
> toggling individual memory blocks is still used by userland tools, and
> will disconnect the `hotplug` value from the actual state of the overall
> memory region.
> 
> Unless we move to deprecate per-block controls, we should just WARN()
> instead of BUG() as an indicator that userland tools need to be updated
> to use the new pattern (the old pattern is subject to race conditions).
> 
> The first two commits are semi-unrelated cleanups that conflict with the
> changes made in the refactoring commits. (memory-tier dedup and align_range
> helper). These are intended to be used for future cxl region extensions,
> but if you prefer them to be dropped or submitted separately let me
> know.
> 
> This is technically v3, but the patch line has diverged considerably and
> I've reworked the cover letter, apologies for prior obtuseness
> Link: https://lore.kernel.org/all/20260114235022.3437787-1-gourry@gourry.net/


Hi Gregory,

against which branch / base commit is this series?

-- 
Cheers,

David


  parent reply	other threads:[~2026-04-13 14:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-21 15:03 Gregory Price
2026-03-21 15:03 ` [PATCH 1/8] mm/memory-tiers: consolidate memory type dedup into mt_get_memory_type() Gregory Price
2026-04-13 15:06   ` David Hildenbrand (Arm)
2026-03-21 15:03 ` [PATCH 2/8] mm/memory: add memory_block_align_range() helper Gregory Price
2026-04-13 15:12   ` David Hildenbrand (Arm)
2026-03-21 15:03 ` [PATCH 3/8] mm/memory_hotplug: pass online_type to online_memory_block() via arg Gregory Price
2026-03-21 15:04 ` [PATCH 4/8] mm/memory_hotplug: export mhp_get_default_online_type Gregory Price
2026-04-13 15:18   ` David Hildenbrand (Arm)
2026-03-21 15:04 ` [PATCH 5/8] mm/memory_hotplug: add __add_memory_driver_managed() with online_type arg Gregory Price
2026-04-13 15:21   ` David Hildenbrand (Arm)
2026-03-21 15:04 ` [PATCH 6/8] dax: plumb hotplug online_type through dax Gregory Price
2026-04-13 15:23   ` David Hildenbrand (Arm)
2026-03-21 15:04 ` [PATCH 7/8] dax/kmem: extract hotplug/hotremove helper functions Gregory Price
2026-03-21 15:04 ` [PATCH 8/8] dax/kmem: add sysfs interface for atomic whole-device hotplug Gregory Price
2026-03-21 17:40 ` [PATCH 0/8] dax/kmem: atomic whole-device hotplug via sysfs Andrew Morton
2026-03-21 20:26   ` Gregory Price
2026-04-13 15:47     ` David Hildenbrand (Arm)
2026-04-13 14:49 ` David Hildenbrand (Arm) [this message]
2026-04-13 14:53   ` David Hildenbrand (Arm)

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=4c08c0a8-9415-4f30-bfa9-db39318fa7d3@kernel.org \
    --to=david@kernel.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=gourry@gourry.net \
    --cc=kernel-team@meta.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=nvdimm@lists.linux.dev \
    --cc=osalvador@suse.de \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=vishal.l.verma@intel.com \
    /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