linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Gregory Price <gourry@gourry.net>,
	"David Hildenbrand (Red Hat)" <david@kernel.org>
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:21:52 +0100	[thread overview]
Message-ID: <b4ce3096-aa52-4cbb-8d5b-c787c1971147@suse.de> (raw)
In-Reply-To: <aV1PQd3tyfSiH4xD@gourry-fedora-PF4VCD3F>

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:
>>> On Tue, Jan 06, 2026 at 04:24:21PM +0100, David Hildenbrand (Red Hat) wrote:
>>>
>>> I'm not against this idea, but it also makes the sysfs a little more
>>> confusing (`echo online` now does different things based on prior
>>> state).
>>
>> Right, but only for the contig-zones policy.
>>
>> But maybe you really want the default for such memory to be "movable" even
>> when not onlined beforehand? So I am not sure if the description of the
>> problem here is accurate.
>>
>> Isn't one problem also udev racing with ndctl?
>>
> 
> Yeah there's a bunch of races, the specific ones mentioned by Hannes i
> need to go back and re-listen to the talk.
> 
udev racing with ndctl is a general problem, and not specific to
zone movable. We definitely should be looking into that.

>>> I preferred just failing if the block wasn't compatible with
>>> the zone (maybe making it more clear with a dmesg print?)
>>
>> The thing is that this block is compatible with the zone, no?
>>
>> In a system where you would never want to offline that memory, why should we
>> stop someone from onlining it to a kernel zone? I'm sure someone with a
>> weird use case will show up later that will complain about this.
>>
> 
> Presumably you wouldn't be setting the MHP flag that prevents the blocks
> from being onlined in a kernel zone then - in which case this all just
> works as intended today.
> 

This is _not_ about never wanting to offline memory.
Quite the contrary, actually: we assume that CXL memory is
hotpluggable, and as such online and offline will happen.
What we need to ensure, though, is that all memory on CXL
always lands in zone movable.

>> But the patch is missing details on who would actually set MHP_MOVABLE_ONLY.
>> A user should be posted alongside the core change.
>>
> 
> This is fair and probably the obvious immediate user would be a dax
> device with some kind of `dax0.0/protect_unplug` feature set.
> (With a better name obviuosly).
> 
> I will defer to Hannes on his specific use case, but I could see the
> CXL-DCD (Dynamic Capacity) set wanting something like this.
> 
The specific use-case is CXL: all memory on CXL should be onlined
to zone movable. The mechanism invoking that (be it udev or ndctl)
is secondary.

>>>
>>> Anyway, let me know what your preference is, happy to pivot however.
>>
>> Restricting memory to be movable-only to handle a user-space problem as
>> described here sounds like the wrong approach to me. You really want the
>> default of such memory to be "movable".
>>
>> Almost like an optimized "auto-movable" policy :)
>>
>> Or a new policy that will respect a provided default (MHP_DEFAULT_MOVABLE).
>>
> 
> Fair, I'll revist this once Hannes gets a chance to chime in.
> 
> This was effective at getting the discussion started though :P
> 
Oh, definitely :-)
Thanks for getting started on this.

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


  parent reply	other threads:[~2026-01-08  7:21 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
2026-01-08 14:16                 ` David Hildenbrand (Red Hat)
2026-01-08  7:21         ` Hannes Reinecke [this message]
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=b4ce3096-aa52-4cbb-8d5b-c787c1971147@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