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 printkChangelog 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_CONTSince 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 printkChangelog 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_CONTSince 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 HansenChangelog 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 printkChangelog 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_CONTSince 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
-
| Jeremy Fitzhardinge | Re: [RFC 00/15] x86_64: Optimize percpu accesses |
| Vladislav Bolkhovitin | Re: Integration of SCST in the mainstream Linux kernel |
| Mike Galbraith | Re: regression: CD burning (k3b) went broke |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Linus Torvalds | Re: [GIT]: Networking |
| Michael Grollman | Re: 8169 Intermittent ifup Failure Issue With RTL8102E Chipset in Intel's New D945... |
