Re: [RFC][PATCH] Memory Hotplug

Dave Hansen
2005-02-18T22:20:55Z

On Fri, 2005-02-18 at 16:52 -0500, Rik van Riel wrote:
> On Thu, 17 Feb 2005, Dave Hansen wrote:
> > The attached patch is a prototype implementation of memory hot-add. It
> > allows you to boot your system, and add memory to it later. Why would
> > you want to do this?
>
> I want it so I can grow Xen guests after they have been booted
> up. Being able to hot-add memory is essential for dynamically
> resizing the memory of various guest OSes, to readjust them for
> the workload.

That's the same thing we like about it on ppc64 partitions.

> Memory hot-remove isn't really needed with Xen, the balloon
> driver takes care of that.

You can free up individual pages back to the hypervisor, but you might
also want the opportunity to free up some unused mem_map if you shrink
the partition by a large amount.

> > I can post individual patches if anyone would like to comment on them.
>
> I'm interested. I want to get this stuff working with Xen ;)

You can either pull them from here:

http://www.sr71.net/patches/2.6.11/2.6.11-rc3-mhp1/broken-out/

or grab the whole tarball:

http://www.sr71.net/patches/2.6.11/2.6.11-rc3-mhp1/broken-out-2.6.11-rc3-mhp1.tar.gz

Or, I could always post the whole bunch to lhms. Nobody there should
mind too much. :)

The largest part of porting hot-add to a new architecture is usually the
sparsemem portion. You'll pretty much have to #ifdef pfn_to_page() and
friends, declare a few macros, and then do a bit of debugging. Here's
ppc64 as an example: