Satoshi Uchida
2006-Sep-25 11:51 UTC
[Xen-devel] [PATCH][Take 2] Sysfs Interface for balloon driver
Hi. This patch provides a sysfs interface for the balloon driver (Take 2). 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/devices/system/memory/. Example outputs of the sysfs interface of the balloon driver are as follows: Example 1. Show each information [root@Dom0 ~]# ls /sys/devices/system/memory/memory0/ balloon_high current_pages hard_limit balloon_low driver_pages target_pages [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/current_pages 262144 [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/target_pages 262144 [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/balloon_high 0 [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/balloon_low 509952 [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/hard_limit ??? [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/driver_pages 1024 Example 2. Set memory size of a domain [root@Dom0 ~]# echo 1024M > /sys/devices/system/memory/memory0/target_pages [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/target_pages 1048576 [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/current_pages 758192 [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/hard_limit 758192 [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/driver_pages 1024 Regards Satoshi UCHIDA NEC Corporation, Japan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Pratt
2006-Sep-25 12:10 UTC
RE: [Xen-devel] [PATCH][Take 2] Sysfs Interface for balloon driver
> This patch provides a sysfs interface for the balloon driver (Take 2). > Example outputs of the sysfs interface of the balloon driver are as > follows: > > Example 1. Show each information > > [root@Dom0 ~]# ls /sys/devices/system/memory/memory0/ > balloon_high current_pages hard_limit > balloon_low driver_pages target_pagesThese names are a bit misleading, confusing pages and KB. Perhaps go for everything in KB, and have a ''_KB'' post fix to all the names e.g. ''current_KB''. Does anyone actually use balloon_low and _high? At the very least they should be renamed, possibly put under an info sub directory. Something that would be good to export via sysfs is the maximum amount of memory the guest could have (for guests that can''t expand their page array i.e. all current guests). Since linux currently doesn''t know the hard limit, perhaps best to remove this node. Thanks, Ian> [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/current_pages > 262144 > [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/target_pages > 262144 > [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/balloon_high > 0 > [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/balloon_low > 509952 > [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/hard_limit > ??? > [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/driver_pages > 1024 > > Example 2. Set memory size of a domain > > [root@Dom0 ~]# echo 1024M > > /sys/devices/system/memory/memory0/target_pages > [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/target_pages > 1048576 > [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/current_pages > 758192 > [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/hard_limit > 758192 > [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/driver_pages > 1024 > > > Regards > Satoshi UCHIDA > NEC Corporation, Japan_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Satoshi Uchida
2006-Sep-26 08:29 UTC
RE: [Xen-devel] [PATCH][Take 2] Sysfs Interface for balloon driver
Ti, Ian> These names are a bit misleading, confusing pages and KB. > > Perhaps go for everything in KB, and have a ''_KB'' post fix to > all the names e.g. ''current_KB''.OK.> Does anyone actually use balloon_low and _high? At the very > least they should be renamed, possibly put under an info sub > directory. >Works the renaming. However, Does it needs to put under an info sub directory? Because both of current pages and high/low memory are information and show states of memory. Perhaps, The parameter is only target pages.> Since linux currently doesn''t know the hard limit, perhaps > best to remove this node. >The hard limit show limitation after ballooning process. The hard limit currently is initialized before ballooning process, so no have its significance. But, at least, anyone know the limitaion by it when ballooning process. Maybe may it be left?> Something that would be good to export via sysfs is the > maximum amount of memory the guest could have (for guests > that can''t expand their page array i.e. all current guests).What is this means? Should information export the limitaion handled within linux? (i.e by mem option) or the limitation controlled at hypervisor (mem-max)? Regard, Satoshi UCHIDA _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Pratt
2006-Sep-26 18:26 UTC
RE: [Xen-devel] [PATCH][Take 2] Sysfs Interface for balloon driver
> > Does anyone actually use balloon_low and _high? At the very > least they > > should be renamed, possibly put under an info sub directory. > > > > > Works the renaming. > > However, Does it needs to put under an info sub directory? > Because both of current pages and high/low memory are > information and show states of memory. > Perhaps, The parameter is only target pages.target_pages (or rather target_KB) is the only thing you can adjust.> > Something that would be good to export via sysfs is the > > maximum amount of memory the guest could have (for guests > > that can''t expand their page array i.e. all current guests). > > What is this means? > Should information export the limitaion handled within linux? > (i.e by mem option) > or the limitation controlled at hypervisor (mem-max)?I guess this is the total of the current memory and the memory in the high and low balloons. Ian _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Satoshi Uchida
2006-Oct-02 11:21 UTC
[Xen-devel] [PATCH][Take 3] Sysfs Interface for balloon driver
Hi. This patch provides a sysfs interface for the balloon driver (Take 3). 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/devices/system/memory/. For Take 2 patch, this patch modifies only target_kB is kept in /sys/devices/system/memory/memory0 as parameter, and other information (ex. current_KB) is moved to info sub directory. The hard limit is remained for the present. Perhaps, anyone maybe used at someday, and it may be useful now. Example outputs of the sysfs interface of the balloon driver are as follows: Example 1. Show each information [root@Dom0 ~]# ls -al /sys/devices/system/memory/memory0/ total 0 drwxr-xr-x 3 root root 0 Oct 2 20:13 . drwxr-xr-x 3 root root 0 Oct 3 2006 .. drwxr-xr-x 2 root root 0 Oct 2 20:11 info -rw-r--r-- 1 root root 4096 Oct 2 20:13 target_kB [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/target_kB 262144 [root@noir ~]# ls -al /sys/devices/system/memory/memory0/info/ total 0 drwxr-xr-x 2 root root 0 Oct 2 20:11 . drwxr-xr-x 3 root root 0 Oct 2 20:13 .. -r--r--r-- 1 root root 4096 Oct 2 20:14 current_kB -r--r--r-- 1 root root 4096 Oct 2 20:14 driver_kB -r--r--r-- 1 root root 4096 Oct 2 20:14 hard_limit_kB -r--r--r-- 1 root root 4096 Oct 2 20:14 high_kB -r--r--r-- 1 root root 4096 Oct 2 20:14 low_kB [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/info/current_kB 262144 [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/info/driver_kB 1024 [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/info/hard_limit_kB ??? [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/info/high_kB 0 [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/info/low_kB 509952 Example 2. Set memory size of a domain [root@Dom0 ~]# echo 1024M > /sys/devices/system/memory/memory0/target_kB [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/target_kB 1048576 [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/info/current_kB 758192 [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/info/hard_limit_kB 758192 [root@Dom0 ~]# cat /sys/devices/system/memory/memory0/info/driver_kB 1024 Regards Satoshi UCHIDA NEC Corporation, Japan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
John Levon
2006-Oct-02 17:05 UTC
Re: [Xen-devel] [PATCH][Take 3] Sysfs Interface for balloon driver
On Mon, Oct 02, 2006 at 08:21:20PM +0900, Satoshi Uchida wrote:> For Take 2 patch, this patch modifies only target_kB is kept in /sys/devices/system/memory/memory0 as parameter,One minor quibble, why the capital ''B''? All the rest of sysfs is in lowercase, and I don''t think you need to clarify the difference between bits and bytes here. regards john _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Satoshi Uchida
2006-Oct-03 00:53 UTC
RE: [Xen-devel] [PATCH][Take 3] Sysfs Interface for balloon driver
Hi, John. I think that the capital ''B'' means Bytes and the small ''b'' means bit, usually. Similarly, the capital ''K'' means binary prefix (power of 2, namely power of 1024) and the small ''k'' means SI prefixes (power of 10, namely power of 1000). (Sorry, I mistake. In patch, I wrote in reverse.) In formal (ICE), it is not classified by the capital or the small letters, but is classified by adding the character ''i'' (ex. Ki is ''Kilobinary'', called ''Kibi''.). So, the addition of character ''i'' will be appropriate. (In this time, ''KiB'' is a appropriate.) Thanks Satoshi UCHIDA> -----Original Message----- > From: John Levon [mailto:levon@movementarian.org] > Sent: Tuesday, October 03, 2006 2:05 AM > To: Satoshi Uchida > Cc: xen-devel@lists.xensource.com; ''Ian Pratt'' > Subject: Re: [Xen-devel] [PATCH][Take 3] Sysfs Interface for > balloon driver > > On Mon, Oct 02, 2006 at 08:21:20PM +0900, Satoshi Uchida wrote: > > > For Take 2 patch, this patch modifies only target_kB is kept in > > /sys/devices/system/memory/memory0 as parameter, > > One minor quibble, why the capital ''B''? All the rest of sysfs > is in lowercase, and I don''t think you need to clarify the > difference between bits and bytes here. > > regards > john >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Satoshi Uchida
2006-Oct-03 06:10 UTC
RE: [Xen-devel] [PATCH][Take 3] Sysfs Interface for balloon driver
Hi. I modified units (filename) in the patch. In the symbol representation, perhaps anyone will mistake their interpretations, and its representation is not used in sysfs usually. In this patch, units is used at ''kibi_bytes'' (kilo binary bytes, 2^10 = 1024) which is formal (IEC) representation. Thanks. Satoshi UCHIDA> -----Original Message----- > From: xen-devel-bounces@lists.xensource.com > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of > Satoshi Uchida > Sent: Tuesday, October 03, 2006 9:54 AM > To: ''John Levon'' > Cc: xen-devel@lists.xensource.com > Subject: RE: [Xen-devel] [PATCH][Take 3] Sysfs Interface for > balloon driver > > Hi, John. > > I think that the capital ''B'' means Bytes and the small ''b'' > means bit, usually. > Similarly, the capital ''K'' means binary prefix (power of 2, > namely power of 1024) and the small ''k'' means SI prefixes > (power of 10, namely power of 1000). > (Sorry, I mistake. In patch, I wrote in reverse.) > > In formal (ICE), it is not classified by the capital or the > small letters, but is classified by adding the character ''i'' > (ex. Ki is ''Kilobinary'', called ''Kibi''.). > So, the addition of character ''i'' will be appropriate. > (In this time, ''KiB'' is a appropriate.) > > Thanks > Satoshi UCHIDA > > > > > -----Original Message----- > > From: John Levon [mailto:levon@movementarian.org] > > Sent: Tuesday, October 03, 2006 2:05 AM > > To: Satoshi Uchida > > Cc: xen-devel@lists.xensource.com; ''Ian Pratt'' > > Subject: Re: [Xen-devel] [PATCH][Take 3] Sysfs Interface > for balloon > > driver > > > > On Mon, Oct 02, 2006 at 08:21:20PM +0900, Satoshi Uchida wrote: > > > > > For Take 2 patch, this patch modifies only target_kB is kept in > > > /sys/devices/system/memory/memory0 as parameter, > > > > One minor quibble, why the capital ''B''? All the rest of sysfs is in > > lowercase, and I don''t think you need to clarify the difference > > between bits and bytes here. > > > > regards > > john > > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Petersson, Mats
2006-Oct-03 08:54 UTC
RE: [Xen-devel] [PATCH][Take 3] Sysfs Interface for balloon driver
> -----Original Message----- > From: xen-devel-bounces@lists.xensource.com > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of John Levon > Sent: 02 October 2006 18:05 > To: Satoshi Uchida > Cc: ''Ian Pratt''; xen-devel@lists.xensource.com > Subject: Re: [Xen-devel] [PATCH][Take 3] Sysfs Interface for > balloon driver > > On Mon, Oct 02, 2006 at 08:21:20PM +0900, Satoshi Uchida wrote: > > > For Take 2 patch, this patch modifies only target_kB is > kept in /sys/devices/system/memory/memory0 as parameter, > > One minor quibble, why the capital ''B''? All the rest of sysfs is in > lowercase, and I don''t think you need to clarify the > difference between > bits and bytes here.To be utterly correct, it should be KB - 1024 Bytes, right? Not 1000 Bytes (kB). I agree that it would make more sense to use lower-case all through tho''. -- Mats> > regards > john > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Satoshi Uchida
2006-Oct-05 00:15 UTC
RE: [Xen-devel] [PATCH][Take 3] Sysfs Interface for balloon driver
Sorry. In the previous mail, we mistake that patch is not attached. I modified units (filename) in the patch. In the symbol representation, perhaps anyone will mistake their interpretations, and its representation is not used in sysfs usually. In this patch, units is used at ''kibi_bytes'' (kilo binary bytes, 2^10 = 1024) which is formal (IEC) representation. Thanks. Satoshi UCHIDA> -----Original Message----- > From: Petersson, Mats [mailto:Mats.Petersson@amd.com] > Sent: Tuesday, October 03, 2006 5:55 PM > To: John Levon; Satoshi Uchida > Cc: Ian Pratt; xen-devel@lists.xensource.com > Subject: RE: [Xen-devel] [PATCH][Take 3] Sysfs Interface for > balloon driver > > > > > -----Original Message----- > > From: xen-devel-bounces@lists.xensource.com > > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of > John Levon > > Sent: 02 October 2006 18:05 > > To: Satoshi Uchida > > Cc: ''Ian Pratt''; xen-devel@lists.xensource.com > > Subject: Re: [Xen-devel] [PATCH][Take 3] Sysfs Interface > for balloon > > driver > > > > On Mon, Oct 02, 2006 at 08:21:20PM +0900, Satoshi Uchida wrote: > > > > > For Take 2 patch, this patch modifies only target_kB is > > kept in /sys/devices/system/memory/memory0 as parameter, > > > > One minor quibble, why the capital ''B''? All the rest of sysfs is in > > lowercase, and I don''t think you need to clarify the difference > > between bits and bytes here. > > To be utterly correct, it should be KB - 1024 Bytes, right? > Not 1000 Bytes (kB). I agree that it would make more sense to > use lower-case all through tho''. > > -- > Mats > > > > regards > > john > > > > _______________________________________________ > > Xen-devel mailing list > > Xen-devel@lists.xensource.com > > http://lists.xensource.com/xen-devel > > > > > > > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
John Levon
2006-Oct-05 00:49 UTC
Re: [Xen-devel] [PATCH][Take 3] Sysfs Interface for balloon driver
On Thu, Oct 05, 2006 at 09:15:04AM +0900, Satoshi Uchida wrote:> I modified units (filename) in the patch.All seems a bit unnecessary (too wordy). Can you explain what''s wrong with "foo_kb" as more than one person has suggested? thanks john _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Satoshi Uchida
2006-Oct-05 06:47 UTC
RE: [Xen-devel] [PATCH][Take 3] Sysfs Interface for balloon driver
Hi, John The final patch (''kibi_bytes'' representation) is made by following reason. Anyone may be wavered in judgment that which is the character ''b'' ''bytes'' or ''bit'' , and similarly does the character ''k'' 1000 or 1024. Many people will be judged rightly by some reason, for example, ''b'' is bytes because corresponding memory or ''k'' means 1024 of using within computer. However, as explaining at the previous mail, in general, ''b'' and ''B'' is used for representation bits and bytes, respectively. Similarly, ''k'' and ''K'' indicate 1000 and 1024m respectively. (In IEC, the latter is used the character ''Ki'' (called kibi, kilobinary)) Therefore, in this time, it will be right to use the character ''KB'' (''KiB''). But, your saying, the rest of sysfs is in lowercase. (In actual, the ''kb'' is also used under /sys/block) Therefore, they occur contradiction. I think that its cause is to abbreviate, and no problems if not abbreviate. So, in this time, I use ''kibi_bytes''. In actual, the ''bytes'' is used under /sys/class/net. (This reason may be that only ''B'' is not much to look at.) I think that it is important for everyone to can understand right immediately more than to abbreviate (the character is a few or only a certain person is familiar). Thanks, Satoshi UCHIDA> -----Original Message----- > From: John Levon [mailto:levon@movementarian.org] > Sent: Thursday, October 05, 2006 9:49 AM > To: Satoshi Uchida > Cc: xen-devel@lists.xensource.com; ''Petersson, Mats'' > Subject: Re: [Xen-devel] [PATCH][Take 3] Sysfs Interface for > balloon driver > > On Thu, Oct 05, 2006 at 09:15:04AM +0900, Satoshi Uchida wrote: > > > I modified units (filename) in the patch. > > All seems a bit unnecessary (too wordy). Can you explain > what''s wrong with "foo_kb" as more than one person has suggested? > > thanks > john >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
John Levon
2006-Oct-05 11:54 UTC
Re: [Xen-devel] [PATCH][Take 3] Sysfs Interface for balloon driver
On Thu, Oct 05, 2006 at 03:47:41PM +0900, Satoshi Uchida wrote:> Anyone may be wavered in judgment that which is the character ''b'' ''bytes'' or ''bit'' , > and similarly does the character ''k'' 1000 or 1024.Hardly, since when is memory measured in 1000 * bytes or kilobits?> So, in this time, I use ''kibi_bytes''. > In actual, the ''bytes'' is used under /sys/class/net.Presumably because ''bits'' is often used for networking, thus the clarification is worthwhile. regards john _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel