All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: "David Hildenbrand (Red Hat)" <david@kernel.org>
Cc: Gregory Price <gourry@gourry.net>,
	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, hare@suse.de
Subject: Re: [RFC PATCH] memory,memory_hotplug: allow restricting memory blocks to zone movable
Date: Wed, 7 Jan 2026 18:19:05 +0100	[thread overview]
Message-ID: <aV6ViYWwA6OBdtMQ@tiehlicka> (raw)
In-Reply-To: <39533aa8-ca78-41a8-b005-9202ce53e3ae@kernel.org>

On Wed 07-01-26 16:09:34, David Hildenbrand wrote:
> On 1/6/26 20:49, Michal Hocko wrote:
> > On Tue 06-01-26 11:53:30, Gregory Price wrote:
> > > On Tue, Jan 06, 2026 at 04:05:48PM +0100, Michal Hocko wrote:
> > > > On Mon 05-01-26 15:36:11, Gregory Price wrote:
> > > > > It was reported (LPC 2025) that userland services which monitor memory
> > > > > blocks can cause hot-unplug to fail permanently.
> > > > > 
> > > > > This can occur when drivers attempt to hot-remove memory in two phases
> > > > > (offline, remove), while a userland service detects the memory offline
> > > > > and re-onlines the memory into a zone which may prevent removal.
> > > > 
> > > > Are there more details about this?
> > > 
> > > The details are with Hannes, I was just recapping what was described in
> > > his devmem talk at LPC ("To online or not online").
> > 
> > I know of policies to online newly added memory blocks but I am not
> > aware of policies to re-online something that has been made offline.
> > > > That being said, rather than movable_only, should we have a mask of
> > > > online types supported for the mem block?
> > > > 
> > > 
> > > I briefly considered this.  I went with this for RFC-v1 since it's
> > > fairly simple and because movable is really the only zone with hotplug
> > > guarantees (any other zone makes no hotplug guarantees).
> > > 
> > > It's also significantly more complex of a change for questionable value,
> > > but if people see this as the way to go i'll happily pivot to that.
> > 
> > Sure, I wouldn't push for more complexity just for the sake of a
> > theoretical extensibility. And I have to admit I have't tried to a quick
> > PoC to see how complex this could grow. I was hoping this could get into
> > a simple mask for online types with default MMOP_ONLINE_KERNEL|MMOP_ONLINE_MOVABLE
> > and special cases just choosing one of the two and zone_for_pfn_range
> > checking for the compatibility with the requested online type. But I do
> > appreciate there might be some obstacles on the way to achieve that.
> 
> If we want to go down that path of failing onlining, we could likely do
> without any core-MM changes: dax can simply register a memory notifier and
> fail MEM_GOING_ONLINE of its memory with -EINVAL when it sees !ZONE_MOVABLE.
> 
> That works, because online_pages() does the move_pfn_range_to_zone() before
> calling MEM_GOING_ONLINE.

Yes, that makes sense as well and it seems rather elegand way to go
about that.

-- 
Michal Hocko
SUSE Labs


  parent reply	other threads:[~2026-01-07 17:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05 20:36 [RFC PATCH] memory,memory_hotplug: allow restricting memory blocks to zone movable 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 [this message]
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-09 16:41                   ` Gregory Price
2026-01-12  7:28                     ` Hannes Reinecke
2026-01-12 14:23                       ` Gregory Price
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=aV6ViYWwA6OBdtMQ@tiehlicka \
    --to=mhocko@suse.com \
    --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=hare@suse.de \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.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 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.