Changelog for version 3 1. Change memory.limit and memory.usage to memory.limit_in_bytes and memory.usage_in_bytes respectively 2. Remove "Bytes" from the output of the limit and usage counters 3. Remove spurious printk Changelog for version 2 1. Back end tracking is done in bytes, round up values of the limit if the specified value is not a multiple of page size. Display memory.usage and memory.limit in bytes (Dave Hansen, Paul Menage) Change the interface to use bytes instead of pages. Page sizes can vary across platforms and configurations. A new strategy routine has been added to the resource counters infrastructure to format the data as desired. Suggested by David Rientjes, Andrew Morton and Herbert Poetzl Tested on a UML setup with the config for memory control enabled. --- Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> --- Documentation/controllers/memory.txt | 28 ++++++++++++++--- include/linux/res_counter.h | 10 +++--- kernel/res_counter.c | 30 +++++++++++++----- mm/memcontrol.c | 56 +++++++++++++++++++++++++++-------- 4 files changed, 94 insertions(+), 30 deletions(-) diff -puN Documentation/controllers/memory.txt~mem-control-make-ui-more-usable Documentation/controllers/memory.txt --- linux-2.6.23-rc4/Documentation/controllers/memory.txt~mem-control-make-ui-more-usable 2007-09-02 15:42:03.000000000 +0530 +++ linux-2.6.23-rc4-balbir/Documentation/controllers/memory.txt 2007-09-02 15:47:12.000000000 +0530 @@ -165,11 +165,29 @@ c. Enable CONFIG_CONTAINER_MEM_CONT Since now we're in the 0 container, We can alter the memory limit: -# echo -n 6000 > /containers/0/memory.limit +# echo -n 4M > /containers/0/memory.limit_in_bytes + +NOTE: We can use a suffix (k, K, m, M, g or G) to indicate values in kilo, +mega or gigabytes. + +# cat /containers/0/memory.limit_in_bytes +4194304 Bytes + +NOTE: The interface has now changed to display the usage in bytes +instead ...
I wonder if we can say this in a bit more generic fashion.
A successful write to this file does not guarantee a successful
set of this limit to the value written into the file. This can
be due to a number of factors, such as rounding up to page
boundaries or the total availability of memory on the system.
The user is required to re-read this file after a write to
guarantee the value committed by the kernel.
This keeps a user from saying "I page aligned the value I stuck in
there, no I don't have to check it."
-- Dave
-and this as simple_strtoull() Paul -
Hi, Here's the new patch for the UI changes. I hope I've got it right (Jetlag can do funny things to the mind and eyes :-) ) Changelog for version 4 1. Fix parsing of unsigned long long arguments. Changelog for version 3 1. Change memory.limit and memory.usage to memory.limit_in_bytes and memory.usage_in_bytes respectively 2. Remove "Bytes" from the output of the limit and usage counters 3. Remove spurious printk Changelog for version 2 1. Back end tracking is done in bytes, round up values of the limit if the specified value is not a multiple of page size. Display memory.usage and memory.limit in bytes (Dave Hansen, Paul Menage) Change the interface to use bytes instead of pages. Page sizes can vary across platforms and configurations. A new strategy routine has been added to the resource counters infrastructure to format the data as desired. Suggested by David Rientjes, Andrew Morton and Herbert Poetzl Tested on a UML setup with the config for memory control enabled. --- Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> --- Documentation/controllers/memory.txt | 28 ++++++++++++++--- include/linux/res_counter.h | 10 +++--- kernel/res_counter.c | 30 +++++++++++++----- mm/memcontrol.c | 56 +++++++++++++++++++++++++++-------- 4 files changed, 94 insertions(+), 30 deletions(-) diff -puN Documentation/controllers/memory.txt~mem-control-make-ui-more-usable Documentation/controllers/memory.txt --- linux-2.6.23-rc4/Documentation/controllers/memory.txt~mem-control-make-ui-more-usable 2007-09-02 11:12:03.000000000 +0100 +++ linux-2.6.23-rc4-balbir/Documentation/controllers/memory.txt 2007-09-02 11:17:12.000000000 +0100 @@ -165,11 +165,29 @@ c. Enable CONFIG_CONTAINER_MEM_CONT Since now we're in the 0 container, We can alter the memory limit: -# echo -n 6000 > /containers/0/memory.limit +# echo -n 4M > /containers/0/memory.limit_in_bytes + +NOTE: We can use a suffix (k, ...
Hi, Paul, This does not need fixing, since the other counters like failcnt are Will do, thanks! -- Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL -
But val is an unsigned long long*. So printing *val with %lu will break (at least a warning, and maybe corruption if you had other parameters) on 32-bit archs. Paul -
How does this look? Changelog for version 4 1. Make all resource counters members unsigned long long 2. Use documentation comments from Dave Hansen Changelog for version 3 1. Change memory.limit and memory.usage to memory.limit_in_bytes and memory.usage_in_bytes respectively 2. Remove "Bytes" from the output of the limit and usage counters 3. Remove spurious printk Changelog for version 2 1. Back end tracking is done in bytes, round up values of the limit if the specified value is not a multiple of page size. Display memory.usage and memory.limit in bytes (Dave Hansen, Paul Menage) Change the interface to use bytes instead of pages. Page sizes can vary across platforms and configurations. A new strategy routine has been added to the resource counters infrastructure to format the data as desired. Suggested by David Rientjes, Andrew Morton and Herbert Poetzl Tested on a UML setup with the config for memory control enabled. Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> --- Documentation/controllers/memory.txt | 29 ++++++++++++++++++++++++----- include/linux/res_counter.h | 12 +++++++----- kernel/res_counter.c | 34 +++++++++++++++++++++++----------- mm/memcontrol.c | 35 +++++++++++++++++++++++++---------- 4 files changed, 79 insertions(+), 31 deletions(-) diff -puN Documentation/controllers/memory.txt~mem-control-make-ui-more-usable Documentation/controllers/memory.txt --- linux-2.6.23-rc4/Documentation/controllers/memory.txt~mem-control-make-ui-more-usable 2007-09-02 11:12:03.000000000 +0100 +++ linux-2.6.23-rc4-balbir/Documentation/controllers/memory.txt 2007-09-05 16:44:41.000000000 +0100 @@ -165,11 +165,30 @@ c. Enable CONFIG_CONTAINER_MEM_CONT Since now we're in the 0 container, We can alter the memory limit: -# echo -n 6000 > /containers/0/memory.limit +# echo -n 4M > /containers/0/memory.limit_in_bytes + +NOTE: We can use a suffix (k, K, m, M, g or G) to ind...
Yeah... Hmm.. just wonder if all the counters should be unsigned long long? failcnt is the only remaining unsigned long counter now. -- Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL -
Thanks for catching it, I'll fix that. -- Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL -
| Greg Kroah-Hartman | [PATCH 019/196] DMA: Convert from class_device to device for DMA engine |
| Tejun Heo | [PATCH 4/7] FUSE: implement direct lseek support |
| Parag Warudkar | BUG: soft lockup - CPU#1 stuck for 15s! [swapper:0] |
| Greg Smith | PostgreSQL pgbench performance regression in 2.6.23+ |
git: | |
| Len Brown | fatal: unable to create '.git/index': File exists |
| Dan Farina | backup or mirror a repository |
| André Goddard Rosa | Using kdiff3 to compare two different revisions of a folder |
| Petko Manolov | git and binary files |
| Richard Stallman | Real men don't attack straw men |
| Steve B | Intel Atom and D945GCLF2 |
| Jeff Ross | U320 Drive on U160 controller? |
| Sunnz | How do I configure sendmail? |
| Eric Dumazet | [PATCH] fs: pipe/sockets/anon dentries should not have a parent |
| Denys Fedoryshchenko | thousands of classes, e1000 TX unit hang |
| Wei Yongjun | [PATCH] xfrm: Fix kernel panic when flush and dump SPD entries |
| Steffen Klassert | [RFC PATCH 4/5] crypto: allow allocation of percpu crypto transforms |
