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/
Home Products Support Community News


Re: [Xen-users] Limits on memory which can be set using xm mem-set

To: Jiri Denemark <jirka@xxxxxxxxxxx>
Subject: Re: [Xen-users] Limits on memory which can be set using xm mem-set
From: Mark Williamson <mark.williamson@xxxxxxxxxxxx>
Date: Sun, 6 Apr 2008 21:49:54 +0100
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sun, 06 Apr 2008 13:50:30 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20080318125806.GM8386@xxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <20080312194017.GD8386@xxxxxxxx> <200803162136.27878.mark.williamson@xxxxxxxxxxxx> <20080318125806.GM8386@xxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.6 (enterprise 0.20070907.709405)
> Thanks for your reply.
> > I've not heard of this behaviour in ballooning before, although to be
> > honest I'd expect such an aggressive shrinking might upset the guest
> > anyhow, so it's not necessarily something you'd want to do in production!
> Well, of course, the guest gets upset if its memory is shrank too much. And
> the lowest amount of memory is related to the maximum memory a domain was
> started with. However, 160MB is quite fine for a guest originally started
> with 3.5GB but only if only few daemons are running in it. For example, for
> a domain with 15GB, it seems the minimum is somewhere around 500MB.

Ok, well if it works for you then fair enough.

I've seen Linux's memory management system get upset when it actually has 
plenty of memory to spare, seemingly because it gets scared when the 
available memory decreases by a large amount :-)  Note that the problem I saw 
wasn't not having /enough/ memory in the guest, it was that the guest went 
into emergency behaviours simply because the memory had suddenly shrunk...

Memory ballooning gets seen by the guest as a big memory allocation, so this 
behaviour is kind of understandable.  The balloon driver is less aggressive 
these days so Linux is probably less scared by it.  Still, I'd advise to 
verify that you can reliably do aggressive ballooning stably before using it 
in production.

This may be less of a problem these days, of course - the balloon drivers I 
managed to really provoke into breaking things were very old indeed.

Note also that a domain that's created with 4G and resized to 400M will 
have /less available memory/ than one that is created for 400M in the first 
place.  That's because the OS will have created larger data structures to 
cope with the larger memory (as pointed out in one of the threads below) - 
again something to bear in mind.

> > echo size_in_bytes > /proc/xen/balloon
> This really helped much.

Ah, glad to hear it :-)

> I tried it and realized that I couldn't shrink the 
> memory below 400MB. So the balloon driver was the culprit. I looked into it
> and found minimum_target() function, which counts minimum memory based on
> domain's maximum memory. However, it's worth noting that the kernel is
> 2.6.21 by SuSE and there is no such function in 2.6.18 kernel from Xen
> 3.2.0 distribution. So the problem is only related to SuSE kernels.

Coincidentially this got recently mentioned on xen-devel.  SuSE provide a 
patch in their balloon driver to prevent over aggressive ballooning, so your 
diagnosis is indeed correct.

Here are some relevant threads:


Push Me Pull You - Distributed SCM tool (http://www.cl.cam.ac.uk/~maw48/pmpu/)

Xen-users mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [Xen-users] Limits on memory which can be set using xm mem-set, Mark Williamson <=