WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] GSoC 2010 - Migration from memory ballooning to memory h

To: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: Re: [Xen-devel] GSoC 2010 - Migration from memory ballooning to memory hotplug in Xen
From: Daniel Kiper <dkiper@xxxxxxxxxxxx>
Date: Fri, 9 Jul 2010 19:11:39 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Daniel Kiper <dkiper@xxxxxxxxxxxx>
Delivery-date: Fri, 09 Jul 2010 10:12:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4C365C30.2090001@xxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20100708194553.GA30124@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <4C365C30.2090001@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.3.28i
On Thu, Jul 08, 2010 at 04:16:00PM -0700, Jeremy Fitzhardinge wrote:
> On 07/08/2010 12:45 PM, Daniel Kiper wrote:
> >   - find free (not claimed by another memory region or device)
> >     memory region of PAGES_PER_SECTION << PAGE_SHIFT
> >     size in iomem_resource,
>
> Presumably in the common case this will be at the end of the memory
> map?  Since a typical PV domain has all its initial memory allocated low
> and doesn't have any holes.

Yes, I know about that however I think it is much better
to write more generic algorithm which also looks for
the holes (not claimed regions) in memory (maybe in the
future something changes). Additionally, this list mostly
is very short and cost of scan is considerably low.

> >   - find all PFNs for choosen memory region
> >     (addr >> PAGE_SHIFT),
> >   - allocate memory from hypervisor by
> >     HYPERVISOR_memory_op(XENMEM_populate_physmap, &memory_region),
>
> Is it actually necessary to allocate the memory at this point?

Yes, it is because mm/memory_hotplug.c:add_memory
(not exactly this one) updates memory map.

> >   - inform system about new memory region and reserve it by
> >     mm/memory_hotplug.c:add_memory(memory_add_physaddr_to_nid(start_addr),
> >                                    start_addr, PAGES_PER_SECTION << 
> > PAGE_SHIFT),
> >   - online memory region by
> >     mm/memory_hotplug.c:online_pages(start_addr >> PAGE_SHIFT,
> >                                      PAGES_PER_SECTION << PAGE_SHIFT).
>
> It seems to me you could add the memory (to get the new struct pages)
> and "online" it, but immediately take a reference to the page and give
> it over to the balloon driver to manage as a ballooned-out page.  Then,
> when you actually need the memory, the balloon driver can provide it in
> the normal way.

I am going to do that in similar way.

> > I am going to send you first version of patch
> > (fully working) next week.
>
> Looking forward to it.  What kernel is it based on?

Ver. 2.6.32.10 however I suppose it will be no problem
to move it to current version.

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel