Re: [PATCH] memcg: update documentation v6

Previous thread: linux-next: Tree for April 8 by Stephen Rothwell on Wednesday, April 7, 2010 - 10:51 pm. (1 message)

Next thread: [v3 Patch 1/3] netpoll: add generic support for bridge and bonding devices by Amerigo Wang on Wednesday, April 7, 2010 - 11:18 pm. (13 messages)
From: KAMEZAWA Hiroyuki
Date: Wednesday, April 7, 2010 - 10:58 pm

==
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Documentation update for memory cgroup

Some informations are old, and  I think current document doesn't work
as "a guide for users".
We need summary of all of our controls, at least.

This patch updates information for current implementations and add a
summary of interfaces. etc...

Changelog:
 - fixed tons of typos.
 - replaced "memcg" with "memory cgroup" AMAP.
 - replaced "mem+swap" with "memory+swap"

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
 Documentation/cgroups/memory.txt |  210 ++++++++++++++++++++++++++++-----------
 1 file changed, 152 insertions(+), 58 deletions(-)

Index: mmotm-temp/Documentation/cgroups/memory.txt
===================================================================
--- mmotm-temp.orig/Documentation/cgroups/memory.txt
+++ mmotm-temp/Documentation/cgroups/memory.txt
@@ -4,16 +4,6 @@ NOTE: The Memory Resource Controller has
 to as the memory controller in this document. Do not confuse memory controller
 used here with the memory controller that is used in hardware.
 
-Salient features
-
-a. Enable control of Anonymous, Page Cache (mapped and unmapped) and
-   Swap Cache memory pages.
-b. The infrastructure allows easy addition of other types of memory to control
-c. Provides *zero overhead* for non memory controller users
-d. Provides a double LRU: global memory pressure causes reclaim from the
-   global LRU; a cgroup on hitting a limit, reclaims from the per
-   cgroup LRU
-
 Benefits and Purpose of the memory controller
 
 The memory controller isolates the memory behaviour of a group of tasks
@@ -33,6 +23,45 @@ d. A CD/DVD burner could control the amo
 e. There are several other use cases, find one or use the controller just
    for fun (to learn and hack on the VM subsystem).
 
+Current Status: linux-2.6.34-mmotm(development version of 2010/April)
+
+Features:
+ - accounting anonymous pages, file caches, swap caches usage and limit them.
+ ...
From: Randy Dunlap
Date: Thursday, April 8, 2010 - 10:32 am

It would be better to use LRU throughout the file instead of using LRU in some





---
~Randy
--

From: KAMEZAWA Hiroyuki
Date: Thursday, April 8, 2010 - 4:50 pm

On Thu, 8 Apr 2010 10:32:09 -0700




Ragards.

--

From: Daisuke Nishimura
Date: Thursday, April 8, 2010 - 6:26 pm

It seems nice overall.

Thank you for your work.

I have a few minor comments.

IIUC, writing to cgroup.procs isn't supported yet. So, I think we don't have to
Is this line necessary ? We say the similar thing above("A PageCache page is
hmm, chapter 2 is used as "2. Memory Control" already :(

Otherwise, it looks good to me.


Thanks,
Daisuke Nishimura.
--

From: KAMEZAWA Hiroyuki
Date: Thursday, April 8, 2010 - 6:45 pm

On Fri, 9 Apr 2010 10:26:26 +0900

It's supported. See Documetaion/cgroup/cgroup.txt


Thanks,

--

From: Daisuke Nishimura
Date: Thursday, April 8, 2010 - 7:11 pm

I can't write to it now.

# echo $$ >/cgroup/memory/01/cgroup.procs
-bash: echo: write error: Invalid argument
# ls -l /cgroup/memory/01/cgroup.procs
-r--r--r-- 1 root root 0 2010-04-09 10:41 /cgroup/memory/01/cgroup.procs
# uname -a
Linux GibsonE 2.6.34-rc3-mm1-00432-g37c11f5 #1 SMP Thu Apr 8 11:03:39 JST 2010 x86_64 x86_64 x86_64 GNU/Linux

And kernel/cgroup.c says:

   3161         {
   3162                 .name = CGROUP_FILE_GENERIC_PREFIX "procs",
   3163                 .open = cgroup_procs_open,
   3164                 /* .write_u64 = cgroup_procs_write, TODO */
   3165                 .release = cgroup_pidlist_release,
   3166                 .mode = S_IRUGO,
   3167         },

IIRC, it's supported once, but the patch was dropped.


Thanks,
Daisuke Nishimura.
--

From: KAMEZAWA Hiroyuki
Date: Thursday, April 8, 2010 - 8:01 pm

On Fri, 9 Apr 2010 11:11:45 +0900
Ouch....I have to fix (our internal) user manual, too.....


Thanks,
-Kame

--

From: KAMEZAWA Hiroyuki
Date: Thursday, April 8, 2010 - 9:45 pm

Thank you all.
==

Documentation update.

Some information are old, and  I think current documentation doesn't work
as "a guide for users".
We need summary of all of our controls, at least.

Changelog: 2010/04/09
* replace 'lru' with 'LRU' and 'oom' with 'OOM'
* fixed double-space breakage
* applied all comments and fixed wrong parts pointed out.
* fixed cgroup.procs

Changelog: 2009/04/07
* fixed tons of typos.
* replaced "memcg" with "memory cgroup" AMAP.
* replaced "mem+swap" with "memory+swap"


Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
 Documentation/cgroups/memory.txt |  277 ++++++++++++++++++++++++++-------------
 1 file changed, 188 insertions(+), 89 deletions(-)

Index: mmotm-temp/Documentation/cgroups/memory.txt
===================================================================
--- mmotm-temp.orig/Documentation/cgroups/memory.txt
+++ mmotm-temp/Documentation/cgroups/memory.txt
@@ -4,16 +4,6 @@ NOTE: The Memory Resource Controller has
 to as the memory controller in this document. Do not confuse memory controller
 used here with the memory controller that is used in hardware.
 
-Salient features
-
-a. Enable control of Anonymous, Page Cache (mapped and unmapped) and
-   Swap Cache memory pages.
-b. The infrastructure allows easy addition of other types of memory to control
-c. Provides *zero overhead* for non memory controller users
-d. Provides a double LRU: global memory pressure causes reclaim from the
-   global LRU; a cgroup on hitting a limit, reclaims from the per
-   cgroup LRU
-
 Benefits and Purpose of the memory controller
 
 The memory controller isolates the memory behaviour of a group of tasks
@@ -33,6 +23,45 @@ d. A CD/DVD burner could control the amo
 e. There are several other use cases, find one or use the controller just
    for fun (to learn and hack on the VM subsystem).
 
+Current Status: linux-2.6.34-mmotm(development version of 2010/April)
+
+Features:
+ - accounting anonymous pages, file ...
From: Daisuke Nishimura
Date: Thursday, April 8, 2010 - 10:50 pm

Looks good to me.

Reviewed-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>

Thanks,
--

From: Randy Dunlap
Date: Friday, April 9, 2010 - 10:04 am

I would have said:

Why remove those leading spaces (indent/text alignment)?



Almost there.  :)

thanks,
---
~Randy
--

From: KAMEZAWA Hiroyuki
Date: Monday, April 12, 2010 - 9:45 pm

Thank you very much for your kindly helps!.
-Kame
=
Documentation update.

Some information are old, and  I think current document doesn't work
as "a guide for users".
We need summary of all of our controls, at least.

Changelog: 2010/04/12
* applied feedback

Changelog: 2010/04/09
* replace 'lru' with 'LRU' and 'oom' with 'OOM'
* fixed double-space breakage
* applied all comments and fixed wrong parts pointed out.
* fixed cgroup.procs

Changelog: 2009/04/07
* fixed tons of typos.
* replaced "memcg" with "memory cgroup" AMAP.
* replaced "mem+swap" with "memory+swap"


Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
 Documentation/cgroups/memory.txt |  276 ++++++++++++++++++++++++++-------------
 1 file changed, 188 insertions(+), 88 deletions(-)

Index: mmotm-temp/Documentation/cgroups/memory.txt
===================================================================
--- mmotm-temp.orig/Documentation/cgroups/memory.txt
+++ mmotm-temp/Documentation/cgroups/memory.txt
@@ -4,16 +4,6 @@ NOTE: The Memory Resource Controller has
 to as the memory controller in this document. Do not confuse memory controller
 used here with the memory controller that is used in hardware.
 
-Salient features
-
-a. Enable control of Anonymous, Page Cache (mapped and unmapped) and
-   Swap Cache memory pages.
-b. The infrastructure allows easy addition of other types of memory to control
-c. Provides *zero overhead* for non memory controller users
-d. Provides a double LRU: global memory pressure causes reclaim from the
-   global LRU; a cgroup on hitting a limit, reclaims from the per
-   cgroup LRU
-
 Benefits and Purpose of the memory controller
 
 The memory controller isolates the memory behaviour of a group of tasks
@@ -33,6 +23,45 @@ d. A CD/DVD burner could control the amo
 e. There are several other use cases, find one or use the controller just
    for fun (to learn and hack on the VM subsystem).
 
+Current Status: linux-2.6.34-mmotm(development version ...
From: Balbir Singh
Date: Monday, April 12, 2010 - 11:04 pm

^^ period might not be appropriate, if it is, n (not) should




-- 
	Three Cheers,
	Balbir
--

From: KAMEZAWA Hiroyuki
Date: Monday, April 12, 2010 - 11:20 pm

On Tue, 13 Apr 2010 11:34:06 +0530


Hmm ? I'm not sure. 

Could you explain why you think removing <> is better ?

Thanks,
-Kame

--

From: Balbir Singh
Date: Monday, April 12, 2010 - 11:48 pm

* KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2010-04-13 15:20:48]:

[snip]


Because it is an actual name as compared to using <> for to be
replaced with the right thing. 

-- 
	Three Cheers,
	Balbir
--

From: KAMEZAWA Hiroyuki
Date: Monday, April 12, 2010 - 11:58 pm

On Tue, 13 Apr 2010 12:18:55 +0530

Should I replace TABs with SPACEs ? I think my mailer doesn't
Did you read cgroup eventer listener ?

"write string like "<event_fd> <memory.usage_in_bytes> <threshold>" to"

means
   <fd of event fd> <fd of memory.usage_in_bytes> <threshold>

Then, it's not actual name. It's can be changed.
Hmm, I'll replace them with <fd of memory.usage_in_bytes>
Here.
==


Documentation update.

Some information are old, and  I think current document doesn't work
as "a guide for users".
We need summary of all of our controls, at least.

Changelog: 2010/04/13
* applied feedback
* fixed <memory.usage_in_bytes> with <fd of memory.usage_in_bytes>
  at explaining how-to-use eventfd.

Changelog: 2010/04/12
* applied feedback

Changelog: 2010/04/09
* replace 'lru' with 'LRU' and 'oom' with 'OOM'
* fixed double-space breakage
* applied all comments and fixed wrong parts pointed out.
* fixed cgroup.procs

Changelog: 2009/04/07
* fixed tons of typos.
* replaced "memcg" with "memory cgroup" AMAP.
* replaced "mem+swap" with "memory+swap"

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
 Documentation/cgroups/memory.txt |  277 ++++++++++++++++++++++++++-------------
 1 file changed, 188 insertions(+), 89 deletions(-)

Index: mmotm-temp/Documentation/cgroups/memory.txt
===================================================================
--- mmotm-temp.orig/Documentation/cgroups/memory.txt
+++ mmotm-temp/Documentation/cgroups/memory.txt
@@ -4,16 +4,6 @@ NOTE: The Memory Resource Controller has
 to as the memory controller in this document. Do not confuse memory controller
 used here with the memory controller that is used in hardware.
 
-Salient features
-
-a. Enable control of Anonymous, Page Cache (mapped and unmapped) and
-   Swap Cache memory pages.
-b. The infrastructure allows easy addition of other types of memory to control
-c. Provides *zero overhead* for non memory controller users
-d. Provides a double LRU: ...
From: Randy Dunlap
Date: Tuesday, April 13, 2010 - 8:54 am

using a         ; there would be even better.

   we




-- 
~Randy
--

From: KAMEZAWA Hiroyuki
Date: Tuesday, April 13, 2010 - 6:22 pm

On Tue, 13 Apr 2010 08:54:28 -0700
Ah, I thought I changed that ....seems my mistake, sorry.

==here==

Documentation update.

Some information are old, and  I think current document doesn't work
as "a guide for users".
We need summary of all of our controls, at least.

Changelog: 2010/04/14
* applied feedback
* Add a text about "memory cgroup" at the place explaining "memory controller"
* adjusted onto Nishimura's memcg-move-charge-of-file-pages.patch
  (add an fix mmaped -> mmapped...Hmm? mapped is better ?)

Changelog: 2010/04/13
* applied feedback
* fixed <memory.usage_in_bytes> with <fd of memory.usage_in_bytes>
  at explaining how-to-use eventfd.

Changelog: 2010/04/12
* applied feedback

Changelog: 2010/04/09
* replace 'lru' with 'LRU' and 'oom' with 'OOM'
* fixed double-space breakage
* applied all comments and fixed wrong parts pointed out.
* fixed cgroup.procs

Changelog: 2009/04/07
* fixed tons of typos.
* replaced "memcg" with "memory cgroup" AMAP.
* replaced "mem+swap" with "memory+swap"

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
 Documentation/cgroups/memory.txt |  289 ++++++++++++++++++++++++++-------------
 1 file changed, 197 insertions(+), 92 deletions(-)

Index: mmotm-temp/Documentation/cgroups/memory.txt
===================================================================
--- mmotm-temp.orig/Documentation/cgroups/memory.txt
+++ mmotm-temp/Documentation/cgroups/memory.txt
@@ -1,18 +1,15 @@
 Memory Resource Controller
 
 NOTE: The Memory Resource Controller has been generically been referred
-to as the memory controller in this document. Do not confuse memory controller
-used here with the memory controller that is used in hardware.
+      to as the memory controller in this document. Do not confuse memory
+      controller used here with the memory controller that is used in hardware.
 
-Salient features
-
-a. Enable control of Anonymous, Page Cache (mapped and unmapped) and
-   Swap Cache memory pages.
-b. ...
From: Randy Dunlap
Date: Wednesday, April 14, 2010 - 11:11 am

BTW:  it would be a lot easier [for reviewing] if you could freeze (or merge) this version
and then apply fixes on top of it with a different (and shorter) patch.

Reviewed-by: Randy Dunlap <randy.dunlap@oracle.com>

---
~Randy
--

From: KAMEZAWA Hiroyuki
Date: Wednesday, April 14, 2010 - 5:34 pm

On Wed, 14 Apr 2010 11:11:46 -0700
Thank you very much for your patient review. It has been very helpful.

Here is fixed one.
==

Documentation update.

Some information are old, and  I think current document doesn't work
as "a guide for users".
We need summary of all of our controls, at least.

Changelog: 2010/04/15
* applied feedback

Changelog: 2010/04/14
* applied feedback
* Add a text about "memory cgroup" at the place explaining "memory controller"
* adjusted onto Nishimura's memcg-move-charge-of-file-pages.patch
  (add an fix mmaped -> mmapped...Hmm? mapped is better ?)

Changelog: 2010/04/13
* applied feedback
* fixed <memory.usage_in_bytes> with <fd of memory.usage_in_bytes>
  at explaining how-to-use eventfd.

Changelog: 2010/04/12
* applied feedback

Changelog: 2010/04/09
* replace 'lru' with 'LRU' and 'oom' with 'OOM'
* fixed double-space breakage
* applied all comments and fixed wrong parts pointed out.
* fixed cgroup.procs

Changelog: 2009/04/07
* fixed tons of typos.
* replaced "memcg" with "memory cgroup" AMAP.
* replaced "mem+swap" with "memory+swap"

Reviewed-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
 Documentation/cgroups/memory.txt |  291 ++++++++++++++++++++++++++-------------
 1 file changed, 198 insertions(+), 93 deletions(-)

Index: mmotm-temp/Documentation/cgroups/memory.txt
===================================================================
--- mmotm-temp.orig/Documentation/cgroups/memory.txt
+++ mmotm-temp/Documentation/cgroups/memory.txt
@@ -1,18 +1,15 @@
 Memory Resource Controller
 
 NOTE: The Memory Resource Controller has been generically been referred
-to as the memory controller in this document. Do not confuse memory controller
-used here with the memory controller that is used in hardware.
+      to as the memory controller in this document. Do not confuse memory
+      controller used here with the memory controller that is used in hardware.
 ...
From: Randy Dunlap
Date: Thursday, April 15, 2010 - 8:48 am

Please ship it!

Thanks.

---
~Randy
--

From: Vivek Goyal
Date: Tuesday, April 13, 2010 - 6:57 am

On Tue, Apr 13, 2010 at 01:45:53PM +0900, KAMEZAWA Hiroyuki wrote:


Because I never understood very well, I will ask. Why lock_page_cgroup()
should not be called under mapping->tree_lock?

Thanks
Vivek
--

From: Vivek Goyal
Date: Tuesday, April 13, 2010 - 7:03 am

Typed wrong email id last time and mail bounced. So here is another
--

From: Balbir Singh
Date: Tuesday, April 13, 2010 - 8:08 am

The closest reference I can find to a conversation regarding this is

http://linux.derkeiler.com/Mailing-Lists/Kernel/2009-05/msg05158.html

-- 
	Three Cheers,
	Balbir
--

From: Vivek Goyal
Date: Tuesday, April 13, 2010 - 8:16 am

Thanks Balbir. So basically idea is that page_cgroup_lock() does not
disable interrupts hence can be interrupted. So don't do
lock_page_cgroup() in interrupt context at all otherwise it can lead to
various kind of deadlock scenarios.

One of those scenarios is lock_page_cgroup() under mapping->tree_lock.

That helps. Thanks

--

Previous thread: linux-next: Tree for April 8 by Stephen Rothwell on Wednesday, April 7, 2010 - 10:51 pm. (1 message)

Next thread: [v3 Patch 1/3] netpoll: add generic support for bridge and bonding devices by Amerigo Wang on Wednesday, April 7, 2010 - 11:18 pm. (13 messages)