OpenVZ Forum - RDF feed
type: channel
items: [PATCH 20/33] memory controller add documentation
items: Re: [PATCH 20/33] memory controller add documentation

[PATCH 20/33] memory controller add documentation
type: item
description: From: Balbir Singh <balbir@linux.vnet.ibm.com> (container->cgroup renaming by Paul Menage <menage@google.com>) Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: Paul Menage <menage@google.com> --- Documentation/controllers/memory.txt | 259 +++++++++++++++++++++++++ 1 files changed, 259 insertions(+) diff -puN /dev/null Documentation/controllers/memory.txt --- /dev/null +++ a/Documentation/controllers/memory.txt @@ -0,0 +1,259 @@ +Memory Controller + +Salient features + +a. Enable control of both RSS (mapped) and Page Cache (unmapped) 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 + +NOTE: Page Cache (unmapped) also includes Swap Cache pages as a subset +and will not be referred to explicitly in the rest of the documentation. + +Benefits and Purpose of the memory controller + +The memory controller isolates the memory behaviour of a group of tasks +from the rest of the system. The article on LWN [12] mentions some probable +uses of the memory controller. The memory controller can be used to + +a. Isolate an application or a group of applications + Memory hungry applications can be isolated and limited to a smaller + amount of memory. +b. Create a cgroup with limited amount of memory, this can be used + as a good alternative to booting with mem=XXXX. +c. Virtualization solutions can control the amount of memory they want + to assign to a virtual machine instance. +d. A CD/DVD burner could control the amount of memory used by the + rest of the system to ensure that burning does not fail due to lack + of available memory. +e. There are several other use cases, find one or use the controller just + for fun (to learn and hack on the VM subsystem). + +1. History + +The memory controller has a long history…
creator: Paul Menage
date: 2007-09-17T21:03:27-00:00

Re: [PATCH 20/33] memory controller add documentation
type: item
description: On Mon, 17 Sep 2007 14:03:27 -0700 Paul Menage wrote: > From: Balbir Singh <balbir@linux.vnet.ibm.com> > (container->cgroup renaming by Paul Menage <menage@google.com>) > > Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> > Signed-off-by: Paul Menage <menage@google.com> > > --- > > Documentation/controllers/memory.txt | 259 +++++++++++++++++++++++++ > 1 files changed, 259 insertions(+) > > diff -puN /dev/null Documentation/controllers/memory.txt > --- /dev/null > +++ a/Documentation/controllers/memory.txt > @@ -0,0 +1,259 @@ > +Benefits and Purpose of the memory controller > + > +The memory controller isolates the memory behaviour of a group of tasks > +from the rest of the system. The article on LWN [12] mentions some probable > +uses of the memory controller. The memory controller can be used to > + > +a. Isolate an application or a group of applications > + Memory hungry applications can be isolated and limited to a smaller > + amount of memory. > +b. Create a cgroup with limited amount of memory, this can be used "," makes run-on sentence. Please use ";" or 2 sentences. > + as a good alternative to booting with mem=XXXX. > +c. Virtualization solutions can control the amount of memory they want > + to assign to a virtual machine instance. > +d. A CD/DVD burner could control the amount of memory used by the > + rest of the system to ensure that burning does not fail due to lack > + of available memory. > +e. There are several other use cases, find one or use the controller just Ditto. > + for fun (to learn and hack on the VM subsystem). [snip] > + > +2.1. Design > + > +The core of the design is a counter called the res_counter. The res_counter > +tracks the current memory usage and limit of the group of processes associated > +with the controller. Each cgroup has a memory controller specific data > +structure (mem_cgroup) associated with it. > + > +2.2. Accounting > + [snip] > + > +The accounting is done as follows: mem_cgroup_charge() is invoked to setup >…
creator: Randy Dunlap
date: 2007-09-18T16:53:13-00:00