From: Jia Rao Subject: Re: How does the self-ballooning daemon calculate the selftarget? Date: Tue, 10 Nov 2009 14:18:54 -0500 Message-ID: <994429490911101118o6e652f73re8fd6975b007d050@mail.gmail.com> References: <994429490911100823m4dff51blbe8720711c24ea37@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1269615764==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Dan Magenheimer Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --===============1269615764== Content-Type: multipart/alternative; boundary=00151758b3b056f6940478092e00 --00151758b3b056f6940478092e00 Content-Type: text/plain; charset=ISO-8859-1 Hi Dan, Thanks for the reply. The XENBALLOON_MINMEM was set to 0 in my case. I am wondering if the /proc/meminfo is a reliable source for memory utilization of a guest. In my case, the guest stays in idle for several hours, the metrics in /proc/meminfo is seldom changed. For example, the Committed_AS and Active metrics stay almost the same for several hours. In earlier kernels, the Active and Inactive metrics are periodically updated by a kernel thread kscand, which seems to has been removed from the 2.6 kernel. >From what I have observed, the meminfo is correctly updated if the memory demand from the guest is increasing. However, once the memory demand drops or be almost zero (idle), the meminfo is not periodically updated. This might be a problem for the self-balloon daemon to deflate the balloon. Thanks, Jia On Tue, Nov 10, 2009 at 12:43 PM, Dan Magenheimer < dan.magenheimer@oracle.com> wrote: > Hi Jia -- > > There are changes in newer versions of the balloon driver to > ensure that ballooning does not take too much memory away > from the kernel, which would result in kernel crashes. > These changes set a different minimum value depending on > how much memory the kernel originally discovered. > > If the self-ballooning scripts run with an "old" balloon > driver and one changes certain parameters > in the scripts, kernel crashes might occur. So the > self-ballooning scripts implement a minimum memory > algorithm similar to the newer balloon driver to > avoid this situation. > > Look for XENBALLOON_MINMEM in the xenballoon config file > if you want to change this. > > Dan > > -----Original Message----- > From: Jia Rao [mailto:rickenrao@gmail.com] > Sent: Tuesday, November 10, 2009 9:23 AM > To: xen-devel@lists.xensource.com > Subject: [Xen-devel] How does the self-ballooning daemon calculate the > selftarget? > > > Hi all, > > I am wondering how does the self-ballooning daemon calculate the selftarget > for the guest OS. > From the README of balloon driver, it seems that selftarget is determined > by Committed_AS in meminfo. > > I did some test on tpcc benchmark. the OS is initially allocated 2048MB of > memory, and then I enabled the selfballooning by echo 1 > /proc/xen/balloon. > The configuration of xenballoond.conf is the default except that I enabled > self-balloon. > > The following is the meminfo > > MemTotal: 1939996 kB > MemFree: 1183888 kB > Buffers: 13260 kB > Cached: 396492 kB > SwapCached: 0 kB > Active: 386912 kB > Inactive: 213584 kB > HighTotal: 0 kB > HighFree: 0 kB > LowTotal: 1939996 kB > LowFree: 1183888 kB > SwapTotal: 2097136 kB > SwapFree: 2097132 kB > Dirty: 78432 kB > Writeback: 0 kB > AnonPages: 190668 kB > Mapped: 14228 kB > Slab: 53148 kB > PageTables: 4836 kB > NFS_Unstable: 0 kB > Bounce: 0 kB > CommitLimit: 3067132 kB > Committed_AS: 524484 kB > VmallocTotal: 34359738367 kB > VmallocUsed: 1208 kB > VmallocChunk: 34359737159 kB > > It seems that the self-balloon driver is reluctant to give up free memory > from the guest although the Committed_AS is small. The self-ballooning did > changed the selftarget to something like 1.6GB but quickly changed to and > fix at 193xxxxKB. > > According to the meminfo, we should be able to give up at least 800MB back > to the VMM. > FYI: xen 3.3.1, linux 2.6.18.8 in both dom0 and domu. > > Any ideas? > > Thanks, > Jia > --00151758b3b056f6940478092e00 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Dan,

Thanks for the reply.
The XENBALLOON_MINMEM was set to 0 = in my case.

I am wondering if the /proc/meminfo is a reliable source= for memory utilization of a guest. In my case, the guest stays in idle for= several hours, the metrics in /proc/meminfo is seldom changed.
For example, the Committed_AS and Active metrics stay almost the same for s= everal hours.

In earlier kernels, the Active and Inactive metrics ar= e periodically updated by a kernel thread kscand, which seems to has been r= emoved from the 2.6 kernel.

From what I have observed, the meminfo is correctly updated if the memo= ry demand from the guest is increasing. However, once the memory demand dro= ps or be almost zero (idle), the meminfo is not periodically updated. This = might be a problem for the self-balloon daemon to deflate the balloon.

Thanks,
Jia

On Tue, Nov 10, 2009 a= t 12:43 PM, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:
Hi Jia --

There are changes in newer versions of the balloon driver to
ensure that ballooning does not take too much memory away
from the kernel, which would result in kernel crashes.
These changes set a different minimum value depending on
how much memory the kernel originally discovered.

If the self-ballooning scripts run with an "old" balloon
driver and one changes certain parameters
in the scripts, kernel crashes might occur. =A0So the
self-ballooning scripts implement a minimum memory
algorithm similar to the newer balloon driver to
avoid this situation.

Look for XENBALLOON_MINMEM in the xenballoon config file
if you want to change this.

Dan

-----Original Message-----
From: Jia Rao [mailto:rickenrao@gmai= l.com]
Sent: Tuesday, November 10, 2009 9:23 AM
To: xen-devel@lists.xensou= rce.com
Subject: [Xen-devel] How does the self-ballooning daemon calculate the self= target?


Hi all,

I am wondering how does the self-ballooning daemon calculate the selftarget= for the guest OS.
>From the README of balloon driver, it seems that selftarget is determined b= y Committed_AS in meminfo.

I did some test on tpcc benchmark. the OS is initially allocated 2048MB of = memory, and then I enabled the selfballooning by echo 1 > /proc/xen/ball= oon.
The configuration of xenballoond.conf is the default except that I enabled = self-balloon.

The following is the meminfo

MemTotal: =A0 =A0 =A01939996 kB
MemFree: =A0 =A0 =A0 1183888 kB
Buffers: =A0 =A0 =A0 =A0 13260 kB
Cached: =A0 =A0 =A0 =A0 396492 kB
SwapCached: =A0 =A0 =A0 =A0 =A00 kB
Active: =A0 =A0 =A0 =A0 386912 kB
Inactive: =A0 =A0 =A0 213584 kB
HighTotal: =A0 =A0 =A0 =A0 =A0 0 kB
HighFree: =A0 =A0 =A0 =A0 =A0 =A00 kB
LowTotal: =A0 =A0 =A01939996 kB
LowFree: =A0 =A0 =A0 1183888 kB
SwapTotal: =A0 =A0 2097136 kB
SwapFree: =A0 =A0 =A02097132 kB
Dirty: =A0 =A0 =A0 =A0 =A0 78432 kB
Writeback: =A0 =A0 =A0 =A0 =A0 0 kB
AnonPages: =A0 =A0 =A0190668 kB
Mapped: =A0 =A0 =A0 =A0 =A014228 kB
Slab: =A0 =A0 =A0 =A0 =A0 =A053148 kB
PageTables: =A0 =A0 =A0 4836 kB
NFS_Unstable: =A0 =A0 =A0 =A00 kB
Bounce: =A0 =A0 =A0 =A0 =A0 =A0 =A00 kB
CommitLimit: =A0 3067132 kB
Committed_AS: =A0 524484 kB
VmallocTotal: 34359738367 kB
VmallocUsed: =A0 =A0 =A01208 kB
VmallocChunk: 34359737159 kB

It seems that the self-balloon driver is reluctant to give up free memory f= rom the guest although the Committed_AS is small. The self-ballooning did c= hanged the selftarget to something like 1.6GB but quickly changed to and fi= x at 193xxxxKB.

According to the meminfo, we should be able to give up at least 800MB back = to the VMM.
FYI: xen 3.3.1, linux 2.6.18.8 in both dom0 and domu.

Any ideas?

Thanks,
Jia

--00151758b3b056f6940478092e00-- --===============1269615764== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1269615764==--