From: Hannes Reinecke <hare@suse.de>
To: "David Hildenbrand (Red Hat)" <david@kernel.org>,
Gregory Price <gourry@gourry.net>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com, osalvador@suse.de,
gregkh@linuxfoundation.org, rafael@kernel.org, dakr@kernel.org,
akpm@linux-foundation.org, lorenzo.stoakes@oracle.com,
Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org,
surenb@google.com, mhocko@suse.com
Subject: Re: [RFC PATCH] memory,memory_hotplug: allow restricting memory blocks to zone movable
Date: Thu, 8 Jan 2026 08:31:16 +0100 [thread overview]
Message-ID: <20baab84-c8b0-4c46-a550-21b26b975d07@suse.de> (raw)
In-Reply-To: <fd21ebf7-d016-4729-8d23-a7c0f2a3d8c6@kernel.org>
On 1/6/26 21:22, David Hildenbrand (Red Hat) wrote:
> On 1/6/26 20:59, Gregory Price wrote:
>> On Tue, Jan 06, 2026 at 07:38:54PM +0100, David Hildenbrand (Red Hat)
>> wrote:
>>> On 1/6/26 19:06, Gregory Price wrote:
>>>> On Tue, Jan 06, 2026 at 06:52:11PM +0100, David Hildenbrand (Red
>>>> Hat) wrote:
>>>>> On 1/6/26 17:58, Gregory Price wrote:
>>>>
>>>> Fair, I'll revist this once Hannes gets a chance to chime in.
>>>>
>>>> This was effective at getting the discussion started though :P
>>>
>>> Hehe, yes.
>>>
>>> Another thing to look into would be to provide a way for ndctl to just
>>> add+online the memory in one shot, without having to go back to walking
>>> memory blocks to online them etc.
>>>
>>
>> I think it's the opposite: offline+remove needing to be done in one step
>> while holding the hotplug lock. Right now, I think you have to do
>> something like
>
> That's what I note below, yes.
>
> For the udev vs. ndctl race to be handled in a
> good way you need add+online be done in one operation.
>
>>
>> daxctl offline-memory ...
>> daxctl destroy ...
>>
>> You can't destroy and have it offline the memory for you in one go IIRC.
>
> As noted below, we have offline_and_remove_memory().
>
> I added the comment:
>
> /*
> * Try to offline and remove memory. Might take a long time to finish
> in case
> * memory is still in use. Primarily useful for memory devices that
> logically
> * unplugged all memory (so it's no longer in use) and want to offline
> + remove
> * that memory.
> */
>
> Nothing speaks against letting dax use that, but the tricky part is that
> offlining might take forever, so one has to be prepared to handle that
> (and letting user space cancel the operation).
>
> And for dax devices that consist of multiple ranges, it can be "fun" having
> some regions removed and others not.
>
> Something to think about :)
>
We had this discussion at LPC. The current interface of having to
individually offline every single memory block is not very
user-friendly. While it provides the best possible granularity, it
really only makes sense for virtual environments where you _can_
hotplug individual blocks.
For hardware-based scenarios memory will always be removed in
larger entities (eg the CXL device), and it's always an 'all-or-nothing'
scenario; you cannot remove individual memory blocks on a CXL device.
So there the memory block abstraction makes less sense, and it
would be good to have a single 'knob' to remove the entire CXL
device and all memory blocks on it.
Sure, it might take some time, but one doesn't need to worry about
restoring the original state if the operation on one block fails.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
next prev parent reply other threads:[~2026-01-08 7:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-05 20:36 Gregory Price
2026-01-06 15:05 ` Michal Hocko
2026-01-06 16:53 ` Gregory Price
2026-01-06 19:49 ` Michal Hocko
2026-01-07 12:47 ` Hannes Reinecke
2026-01-07 17:17 ` Michal Hocko
2026-01-07 15:09 ` David Hildenbrand (Red Hat)
2026-01-07 16:00 ` Gregory Price
2026-01-07 17:19 ` Michal Hocko
2026-01-06 15:24 ` David Hildenbrand (Red Hat)
2026-01-06 16:58 ` Gregory Price
2026-01-06 17:52 ` David Hildenbrand (Red Hat)
2026-01-06 18:06 ` Gregory Price
2026-01-06 18:38 ` David Hildenbrand (Red Hat)
2026-01-06 19:59 ` Gregory Price
2026-01-06 20:22 ` David Hildenbrand (Red Hat)
2026-01-08 7:31 ` Hannes Reinecke [this message]
2026-01-08 14:16 ` David Hildenbrand (Red Hat)
2026-01-08 7:21 ` Hannes Reinecke
2026-01-08 7:22 ` Hannes Reinecke
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=20baab84-c8b0-4c46-a550-21b26b975d07@suse.de \
--to=hare@suse.de \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=dakr@kernel.org \
--cc=david@kernel.org \
--cc=gourry@gourry.net \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@suse.com \
--cc=osalvador@suse.de \
--cc=rafael@kernel.org \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
/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