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


[Xen-devel] [PATCH] Sysfs Interface for balloon driver

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Sysfs Interface for balloon driver
From: "Satoshi Uchida" <s-uchida@xxxxxxxxxxxxx>
Date: Wed, 20 Sep 2006 09:26:43 +0900
Delivery-date: Tue, 19 Sep 2006 17:27:18 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcbcSx0IxSSejBBzTyKA8o0/M8+67wAADoXQ

This patch provides a sysfs interface for the balloon driver.

Currently, the interface for the balloon driver is provided by procfs.
However, I was suggested by Kier and Anthony that procfs should handle  only 
process information and other information should be located in sysfs,  when I 
made the interface for virtual block devices.

The information for the balloon driver also should be moved to sysfs.
So, I have made a sysfs interface for the balloon driver.

The information for balloon driver is placed in /sys/bus/xen/driver/balloon.
I thought of other locations for the information, such as /sys/class/mem or 
/sys/devices/xen, but I finally selected the place because the balloon driver 
is similar to the front-end driver.
Please comments about that location.

Example outputs of the sysfs interface of the balloon driver are as follows:

 Example 1.  Show each information

    [root@Dom0 ~]# ls /sys/bus/xen/drivers/
    balloon/  pcifront/ vbd/
    [root@Dom0 ~]# ls /sys/bus/xen/drivers/balloon/
    bind  statistics  unbind
    [root@Dom0 ~]# ls /sys/bus/xen/drivers/balloon/statistics/
    balloon_high  current_pages  hard_limit
    balloon_low   driver_pages   target_pages
    [root@Dom0 ~]# cat /sys/bus/xen/drivers/balloon/statistics/balloon_high
          0 kB
    [root@Dom0 ~]# cat /sys/bus/xen/drivers/balloon/statistics/balloon_low
       510976 kB
   [root@Dom0 ~]# cat /sys/bus/xen/drivers/balloon/statistics/current_pages
       262144 kB
   [root@Dom0 ~]# cat /sys/bus/xen/drivers/balloon/statistics/driver_pages
       1024 kB
   [root@Dom0 ~]# cat /sys/bus/xen/drivers/balloon/statistics/hard_limit
       ??? kB

 Example 2. Set memory size of a domain

   [root@Dom0 ~]# cat /sys/bus/xen/drivers/balloon/statistics/target_pages
     262144 kB
   [root@Dom0 ~]# echo 1024M > 
   [root@Dom0 ~]# cat /sys/bus/xen/drivers/balloon/statistics/target_pages
    1048576 kB
   [root@Dom0 ~]# cat /sys/bus/xen/drivers/balloon/statistics/current_pages
     758192 kB
   [root@Dom0 ~]# cat /sys/bus/xen/drivers/balloon/statistics/hard_limit
     758192 kB

The information for VMs should be located one place.
I want to propose a new location for the information of VMs, for example:
  /sys/virtualization -+--- domain
                               +--- hypervisor

Satoshi UCHIDA 
   NEC Corporation, Japan

Attachment: balloon_sysfs.patch
Description: Binary data

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Xen-devel mailing list