virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Gregory Price <gourry@gourry.net>
To: David Hildenbrand <david@redhat.com>
Cc: "Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
	linux-mm@kvack.org, linux-cxl@vger.kernel.org,
	"Davidlohr Bueso" <dave@stgolabs.net>,
	"Ira Weiny" <ira.weiny@intel.com>,
	"John Groves" <John@groves.net>,
	virtualization@lists.linux.dev,
	"Oscar Salvador" <osalvador@suse.de>,
	qemu-devel@nongnu.org, "Dave Jiang" <dave.jiang@intel.com>,
	"Dan Williams" <dan.j.williams@intel.com>,
	linuxarm@huawei.com, wangkefeng.wang@huawei.com,
	"John Groves" <jgroves@micron.com>, "Fan Ni" <fan.ni@samsung.com>,
	"Navneet Singh" <navneet.singh@intel.com>,
	"“Michael S. Tsirkin”" <mst@redhat.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [RFC] Virtualizing tagged disaggregated memory capacity (app specific, multi host shared)
Date: Fri, 20 Sep 2024 11:06:09 +0200	[thread overview]
Message-ID: <Zu07AU3aUrHBMXaw@PC2K9PVX.TheFacebook.com> (raw)
In-Reply-To: <fc05d089-ce04-42d2-a0d7-ea32fd73fe90@redhat.com>

> > 2. Coarse grained memory increases for 'normal' memory.
> >     Can use memory hot-plug. Recovery of capacity likely to only be possible on
> >     VM shutdown.
> 
> Is there are reason "movable" (ZONE_MOVABLE) is not an option, at least in
> some setups? If not, why?
>


This seems like a bit of a muddied conversation.

"'normal' memory" has no defined meaning - so lets clear this up a bit

There is:
* System-RAM (memory managed by kernel allocators)
* Special Purpose Memory (generally presented as DAX)

System-RAM is managed as zones - the relevant ones are
* ZONE_NORMAL allows both movable and non-movable allocations
* ZONE_MOVABLE only allows non-movable allocations
  (Caveat: this generally only applies to allocation, you can
   violate this with stuff like pinning)

Hotplug can be thought of as two discrete mechanisms
* Exposing capacity to the kernel (CXL DCD Transactions)
* Exposing capacity to allocators (mm/memory-hotplug.c)

1) if the intent is to primarily utilize dynamic capacity for VMs, then
   the host does not need (read: should not need) to map the memory as
   System-RAM in the host. The VMM should be made to consume it directly
   via DAX or otherwise.

   That capacity is almost by definition "Capital G Guaranteed" to be
   reclaimable regardless of what the guest does. A VMM can force a guest
   to let go of resources - that's its job.

2) if the intent is to provide dynamic capacity to a host as System-RAM, then
   recoverability is dictated by system usage of that capacity. If onlined
   into ZONE_MOVABLE, then if the system has avoided doing things like pinning
   those pages it should *generally* be recoverable (but not guaranteed).


For the virtualization discussion:

Hotplug and recoverability is a non-issue.  The capacity should never be
exposed to system allocators and the VMM should be made to consume special
purpose memory directly. That's on the VMM/orchestration software to get right.


For the host System-RAM discussion:

Auto-onlined hotplug capacity presently defaults to ZONE_NORMAL, but we
discussed (yesterday, at Plumbers) changing this default to ZONE_MOVABLE.

The only concern is when insufficient ZONE_NORMAL exists to support
ZONE_MOVABLE capacity - but this is unlikely to be the general scenario AND
can be mitigated w/ existing mechanisms.

Manually onlined capacity defaults to ZONE_MOVABLE.

It would be nice to make this behavior consistent, since the general opinion
appears to be that this capacity should default to ZONE_MOVABLE.

~Gregory

  reply	other threads:[~2024-09-20  9:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-15 16:22 [RFC] Virtualizing tagged disaggregated memory capacity (app specific, multi host shared) Jonathan Cameron
2024-08-16  7:05 ` Hannes Reinecke
2024-08-16  9:41   ` Jonathan Cameron
2024-08-19  2:12 ` John Groves
2024-08-19 15:40   ` Jonathan Cameron
2024-09-17 19:56     ` Jonathan Cameron
2024-09-18 12:12       ` Jonathan Cameron
     [not found]     ` <A4E80580-437F-46D8-A58B-D2F3851D67BD>
2024-10-22 14:11       ` Gregory Price
2024-09-19  9:09 ` David Hildenbrand
2024-09-20  9:06   ` Gregory Price [this message]
2024-10-22  9:33     ` David Hildenbrand
2024-10-22 14:24       ` Gregory Price
2024-10-22 14:35         ` David Hildenbrand

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=Zu07AU3aUrHBMXaw@PC2K9PVX.TheFacebook.com \
    --to=gourry@gourry.net \
    --cc=John@groves.net \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=david@redhat.com \
    --cc=fan.ni@samsung.com \
    --cc=imammedo@redhat.com \
    --cc=ira.weiny@intel.com \
    --cc=jgroves@micron.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxarm@huawei.com \
    --cc=mst@redhat.com \
    --cc=navneet.singh@intel.com \
    --cc=osalvador@suse.de \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=virtualization@lists.linux.dev \
    --cc=wangkefeng.wang@huawei.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;
as well as URLs for NNTP newsgroup(s).