From: Gregory Price <gourry@gourry.net>
To: "David Hildenbrand (Red Hat)" <david@kernel.org>
Cc: linux-mm@kvack.org, linux-cxl@vger.kernel.org,
nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org,
virtualization@lists.linux.dev, kernel-team@meta.com,
dan.j.williams@intel.com, vishal.l.verma@intel.com,
dave.jiang@intel.com, mst@redhat.com, jasowang@redhat.com,
xuanzhuo@linux.alibaba.com, eperezma@redhat.com,
osalvador@suse.de, akpm@linux-foundation.org
Subject: Re: [PATCH 2/8] mm/memory_hotplug: extract __add_memory_resource() and __offline_memory()
Date: Wed, 14 Jan 2026 12:11:49 -0500 [thread overview]
Message-ID: <aWfOVd3_GGTNHKNt@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <c4ed9675-269c-4764-86d5-87f4f83fc74d@kernel.org>
On Wed, Jan 14, 2026 at 11:14:21AM +0100, David Hildenbrand (Red Hat) wrote:
> On 1/14/26 09:51, Gregory Price wrote:
> > Extract internal helper functions with explicit parameters to prepare
> > for adding new APIs that allow explicit online type control:
> >
> > - __add_memory_resource(): accepts an explicit online_type parameter.
> > Add MMOP_SYSTEM_DEFAULT as a new value that instructs the function
> > to use mhp_get_default_online_type() for the actual online type.
> > The existing add_memory_resource() becomes a thin wrapper that
> > passes MMOP_SYSTEM_DEFAULT to preserve existing behavior.
> >
> > - __offline_memory(): extracted from offline_and_remove_memory() to
> > handle the offline operation with rollback support. The caller
> > now handles locking and the remove step separately.
>
>
> I don't understand why this change is even part of this patch, can you
> elaborate? You don't add any "explicit parameters to prepare for adding new
> APIs that allow explicit online type control" there.
>
> So likely you squeezed two independent things into a single patch? :)
>
> Likely you should pair the __add_memory_resource() change with the
> add_memory_driver_managed() changed and vice versa.
>
I tried to keep the refactor work and the new feature work separate.
But yeah that's fair i can just add them to the respective path.
> > + /* Use system default online type from mhp_get_default_online_type(). */
> > + MMOP_SYSTEM_DEFAULT,
>
> I don't like having fake options as part of this interface.
>
> Why can't we let selected users use mhp_get_default_online_type() instead?
> Like add_memory_resource(). We can export that function.
>
Wasn't sure if that was preferred, I can do that.
I think i eventually ended up doing that in DAX anyway, I just never
came back around to clean it up.
ack.
~Gregory
next prev parent reply other threads:[~2026-01-14 17:12 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-14 8:51 Subject: [PATCH 0/8] dax/kmem: add runtime hotplug state control Gregory Price
2026-01-14 8:51 ` [PATCH 1/8] mm/memory_hotplug: pass online_type to online_memory_block() via arg Gregory Price
2026-01-14 9:46 ` David Hildenbrand (Red Hat)
2026-01-14 8:51 ` [PATCH 2/8] mm/memory_hotplug: extract __add_memory_resource() and __offline_memory() Gregory Price
2026-01-14 10:14 ` David Hildenbrand (Red Hat)
2026-01-14 17:11 ` Gregory Price [this message]
2026-01-14 8:51 ` [PATCH 3/8] mm/memory_hotplug: add APIs for explicit online type control Gregory Price
2026-01-14 10:21 ` David Hildenbrand (Red Hat)
2026-01-14 17:27 ` Gregory Price
2026-01-14 8:51 ` [PATCH 4/8] mm/memory_hotplug: return online type from add_memory_driver_managed() Gregory Price
2026-01-14 10:49 ` David Hildenbrand (Red Hat)
2026-01-14 17:28 ` Gregory Price
2026-01-14 8:51 ` [PATCH 5/8] dax/kmem: extract hotplug/hotremove helper functions Gregory Price
2026-01-14 8:51 ` [PATCH 6/8] dax/kmem: add online/offline " Gregory Price
2026-01-14 8:51 ` [PATCH 7/8] dax/kmem: add sysfs interface for runtime hotplug state control Gregory Price
2026-01-14 10:55 ` David Hildenbrand (Red Hat)
2026-01-14 17:32 ` Gregory Price
2026-01-14 18:11 ` Gregory Price
2026-01-14 8:52 ` [PATCH 8/8] dax/kmem: add memory notifier to block external state changes Gregory Price
2026-01-14 9:44 ` David Hildenbrand (Red Hat)
2026-01-14 17:07 ` Gregory Price
2026-01-14 17:36 ` Gregory Price
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=aWfOVd3_GGTNHKNt@gourry-fedora-PF4VCD3F \
--to=gourry@gourry.net \
--cc=akpm@linux-foundation.org \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=david@kernel.org \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=kernel-team@meta.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mst@redhat.com \
--cc=nvdimm@lists.linux.dev \
--cc=osalvador@suse.de \
--cc=virtualization@lists.linux.dev \
--cc=vishal.l.verma@intel.com \
--cc=xuanzhuo@linux.alibaba.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