Mailing List Archive

How to know if the balloon driver is running
Hi,
I would like to know if my domU runs with the balloon driver activated.
My configuration is as follows:
-Xen 4.2
-dom0: 3.8.0-29-generic #42~precise1-Ubuntu, x86_64 x86_64 x86_64
-domU: PV mode, running the same version of Ubuntu as the dom0

######################
Configuration file to start de domU:
name = "vm.pv"
kernel = "/boot/vmlinuz-3.8.0-29-generic"
ramdisk = "/tmp/initramfs-3.8.0-29-generic"
extra = "root=/dev/xvda1 ro"
*memory = 512**
**maxmem = 1024*
vcpus = 1
disk = [ 'xxx,raw,xvda1,rw', 'xxx,raw,xvda2,rw']
######################
The swap disk size of the VM is 1Gb.

Inside my VM I have this:
######################
root@XXXXX:~# dmesg |grep balloon
[ 0.030009] xen/balloon: Initialising balloon driver.
[ 0.032393] xen-balloon: Initialising balloon driver.

######################
root@XXXXX:~# lsmod |grep xen
xen_evtchn 13084 0
xen_gntdev 17794 0
xen_gntalloc 13275 0
xen_blkback 27338 0 [permanent]
xen_netback 32166 0 [permanent]
xenfs 12985 1
xen_privcmd 13220 1 xenfs
######################
root@XXXXX:~# cat /etc/fstab
none /proc/xen xenfs defaults 0 0
/dev/xvda1 / ext3 errors=remount-ro 0 1
/dev/xvda2 none swap sw 0 0

Regarding the README file provided with the xen source code
(xxx/xen-4.2-testing.hg/tools/xenballoon), it is said that the balloon
driver is running if the file /proc/xen/balloon exists. It doesn't exist
in my VM.
######################
root@XXXXX:~# ls /proc/xen/
capabilities privcmd xenbus

But there is some files in the /sys file system which refers to the
selfballooning. Does that mean that the balloon driver is running? If it
is the case, how is about /proc/xen/balloon? Else, how to activate the
balloon driver?
######################
root@XXXXX:~# find /sys/ -name *balloon*
/sys/devices/system/xen_memory/xen_memory0/selfballoon
/sys/devices/system/xen_memory/xen_memory0/selfballoon/selfballoon_min_usable_mb
/sys/devices/system/xen_memory/xen_memory0/selfballoon/selfballoon_interval
/sys/devices/system/xen_memory/xen_memory0/selfballoon/selfballooning
/sys/devices/system/xen_memory/xen_memory0/selfballoon/selfballoon_reserved_mb
/sys/devices/system/xen_memory/xen_memory0/selfballoon/selfballoon_uphysteresis
/sys/devices/system/xen_memory/xen_memory0/selfballoon/selfballoon_downhysteresis

Thanks in advance & regards,
Alain
Re: How to know if the balloon driver is running [ In reply to ]
On Thu, 2014-01-23 at 09:11 +0100, napster wrote:
> But there is some files in the /sys file system which refers to the
> selfballooning. Does that mean that the balloon driver is running? If
> it is the case, how is about /proc/xen/balloon? Else, how to activate
> the balloon driver?

IIRC the core balloon driver is always present when Xen is enabled and
so the kernel will respond to requests from the host/toolstack to change
the amount of RAM (e.g "xm/xl mem-set foo" in dom0, which would result
in changes to /proc/meminfo).

In order to get in-guest access to control ballooning you need to
CONFIG_XEN_BALLOON enable and load the xen-balloon.ko module. I'm not
sure but I think with modern kernels this will appear in /sys and
not /proc.

It seems like the docs might be out of date and/or incomplete here. If
you would be so kind as to produce a docs patch against xen.git (see [0]
for tips) or create/update a page on the wiki once you've figured this
out then we would be very grateful -- conveniently there is a document
day[1] on Monday.

The selfballoon stuff is a separate thing (although related), it's
something to do with tmem AFAIUI.

Ian.

[0] http://wiki.xen.org/wiki/Submitting_Xen_Patches
[1] http://wiki.xen.org/wiki/Xen_Document_Days


_______________________________________________
Xen-users mailing list
Xen-users@lists.xen.org
http://lists.xen.org/xen-users
Re: How to know if the balloon driver is running [ In reply to ]
Hi Ian,

So let me seeif I understand youcorrectly. If the CONFIG_XEN_BALLOON is
enabled (as in my case),
root@xxxx# grep CONFIG_XEN_BALLOON /boot/config-3.8.0-35-generic
CONFIG_XEN_BALLOON=y
CONFIG_XEN_BALLOON_MEMORY_HOTPLUG=y
then the balloon driver is automatically started at boot time by the domU.

Finally, regarding the files in
/sys/devices/system/xen_memory/xen_memory0/selfballoon (inside the
domU), are they used by the balloon driver or the selfballoon daemon?

Thanks
Alain

> On Thu, 2014-01-23 at 09:11 +0100, napster wrote:
> > But there is some files in the /sys file system which refers to the
> > selfballooning. Does that mean that the balloon driver is running? If
> > it is the case, how is about /proc/xen/balloon? Else, how to activate
> > the balloon driver?

> IIRC the core balloon driver is always present when Xen is enabled and
> so the kernel will respond to requests from the host/toolstack to change
> the amount of RAM (e.g "xm/xl mem-set foo" in dom0, which would result
> in changes to /proc/meminfo).

> In order to get in-guest access to control ballooning you need to
> CONFIG_XEN_BALLOON enable and load the xen-balloon.ko module. I'm not
> sure but I think with modern kernels this will appear in /sys and
> not /proc.



> It seems like the docs might be out of date and/or incomplete here. If
> you would be so kind as to produce a docs patch against xen.git (see [0]
> for tips) or create/update a page on the wiki once you've figured this
> out then we would be very grateful -- conveniently there is a document
> day[1] on Monday.

> The selfballoon stuff is a separate thing (although related), it's
> something to do with tmem AFAIUI.

> Ian.

> [0] http://wiki.xen.org/wiki/Submitting_Xen_Patches
> [1] http://wiki.xen.org/wiki/Xen_Document_Days


_______________________________________________
Xen-users mailing list
Xen-users [at] lists
http://lists.xen.org/xen-users
Re: How to know if the balloon driver is running [ In reply to ]
On Sun, 2014-01-26 at 11:09 +0100, napster wrote:
> Hi Ian,
>
> So let me see if I understand you correctly. If the CONFIG_XEN_BALLOON
> is enabled (as in my case),
> root@xxxx# grep CONFIG_XEN_BALLOON /boot/config-3.8.0-35-generic
> CONFIG_XEN_BALLOON=y
> CONFIG_XEN_BALLOON_MEMORY_HOTPLUG=y
> then the balloon driver is automatically started at boot time by the
> domU.

AFAIK the balloon driver is started if you just have CONFIG_XEN.

LIke I said before CONFIG_XEN_BALLOON enables additional support for
controlling the balloon driver from within the guest (as opposed to from
the host toolstack).

>
> Finally, regarding the files
> in /sys/devices/system/xen_memory/xen_memory0/selfballoon (inside the
> domU), are they used by the balloon driver or the selfballoon daemon?

I'd say from the name that it is clearly the selfballoon driver.

Ian.


_______________________________________________
Xen-users mailing list
Xen-users@lists.xen.org
http://lists.xen.org/xen-users
Re: How to know if the balloon driver is running [ In reply to ]
Thanks for your reply Ian.

Alain

On 27/01/2014 11:00, Ian Campbell wrote:
> On Sun, 2014-01-26 at 11:09 +0100, napster wrote:
>> Hi Ian,
>>
>> So let me see if I understand you correctly. If the CONFIG_XEN_BALLOON
>> is enabled (as in my case),
>> root@xxxx# grep CONFIG_XEN_BALLOON /boot/config-3.8.0-35-generic
>> CONFIG_XEN_BALLOON=y
>> CONFIG_XEN_BALLOON_MEMORY_HOTPLUG=y
>> then the balloon driver is automatically started at boot time by the
>> domU.
> AFAIK the balloon driver is started if you just have CONFIG_XEN.
>
> LIke I said before CONFIG_XEN_BALLOON enables additional support for
> controlling the balloon driver from within the guest (as opposed to from
> the host toolstack).
>
>> Finally, regarding the files
>> in /sys/devices/system/xen_memory/xen_memory0/selfballoon (inside the
>> domU), are they used by the balloon driver or the selfballoon daemon?
> I'd say from the name that it is clearly the selfballoon driver.
>
> Ian.
>
>


_______________________________________________
Xen-users mailing list
Xen-users@lists.xen.org
http://lists.xen.org/xen-users