linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Emelyanov <xemul@openvz.org>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"menage@google.com" <menage@google.com>,
	"balbir@linux.vnet.ibm.com" <balbir@linux.vnet.ibm.com>,
	"lizf@cn.fujitsu.com" <lizf@cn.fujitsu.com>,
	"yamamoto@valinux.co.jp" <yamamoto@valinux.co.jp>
Subject: Re: [RFC][PATCH 1/3] memcg: documentation for controll file
Date: Tue, 20 May 2008 13:04:33 +0400	[thread overview]
Message-ID: <48329421.8080904@openvz.org> (raw)
In-Reply-To: <20080520180552.601da567.kamezawa.hiroyu@jp.fujitsu.com>

KAMEZAWA Hiroyuki wrote:
> Add a documentation for memory resource controller's files.
> 
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

I have described some files, that should be created by a control group,
which uses a res_counter in Documentation/controllers/resource_counter.txt
section 4.

Maybe it's worth adding a reference to this file, or even rework this
text? How do you think?

> Index: mm-2.6.26-rc2-mm1/Documentation/controllers/memory_files.txt
> ===================================================================
> --- /dev/null
> +++ mm-2.6.26-rc2-mm1/Documentation/controllers/memory_files.txt
> @@ -0,0 +1,76 @@
> +Files under memory resource controller and its resource counter.
> +(See controllers/memory.txt about memory resource controller)
> +
> +* memory.usage_in_bytes
> +  (read)
> +  Currently accounted memory usage under memory controller in bytes.
> +  multiple of PAGE_SIZE.
> +
> +  Even if there is no tasks under controller, some page caches and
> +  swap caches are still accounted. (See memory.force_empty below.)
> +
> +  (write)
> +  no write operation
> +
> +* memory.limit_in_bytes
> +  (read)
> +  Current limit of usage to this memory resource controller in bytes.
> +  (write)
> +  Set limit to this memory resource controller.
> +  A user can use "K', 'M', 'G' to specify the limit.
> +
> +  (Example) You can set limit of 400M by following.
> +  % echo 400M > /path to cgroup/memory.limit_in_bytes
> +
> +* memory.max_usage_in_bytes
> +  (read)
> +  Recorded maximum memory usage under this memory controller.
> +
> +  (write)
> +  Reset the record to 0.
> +
> +  (example usage)
> +  1. create a cgroup
> +  % mkdir /path_to_cgroup/my_cgroup.
> +
> +  2. enter the cgroup
> +  % echo $$ > /path_to_cgroup/my_cgroup/tasks.
> +
> +  3. Run your program
> +  % Run......
> +
> +  4. See how much you used.
> +  % cat /path_to_cgroup/my_cgroup/memory.max_usage_in_bytes.
> +
> +  Now you know how much your application will use. Maybe this
> +  can be a good to set  limits_in_bytes to some proper value.
> +
> +* memory.force_empty
> +  (read)
> +  not allowed.
> +  (write)
> +  Drop all charges under cgroup. This can be called only when
> +  there is no task under this cgroup. This is here for debug purpose.
> +
> +* memory.stat
> +  (read)
> +  show 6 values. (will change in future)
> +  cache          .... usage accounted as File-Cache.
> +  anon/swapcache .... usage accounted as anonymous memory or swapcache.
> +  pgpgin         .... # of page-in under this cgroup.
> +  pgpgout        .... # of page-out under this cgroup
> +  active         .... amounts of memory which is treated as 'active' 
> +  inactive       .... amounts of memory which is treated as 'inactive'
> +  (write)
> +  not allowed 
> +
> +* memory.failcnt
> +  (read)
> +  The number of blocked memory allocation.
> +  Until the usage reaches the limit, memory allocation is not blocked.
> +  When it reaches, memory allocation is blocked and try to reclaim memory
> +  from LRU.
> +
> +  (write)
> +  Reset to 0.
> +
> 
> 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-05-20  9:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-20  9:05 KAMEZAWA Hiroyuki
2008-05-20  9:04 ` Pavel Emelyanov [this message]
2008-05-20  9:23   ` KAMEZAWA Hiroyuki
2008-05-20  9:08 ` [RFC][PATCH 2/3] memcg:: seq_ops support for cgroup KAMEZAWA Hiroyuki
2008-05-20  9:23   ` Pavel Emelyanov
2008-05-20 18:46   ` Paul Menage
2008-05-21  0:28     ` KAMEZAWA Hiroyuki
2008-05-21  5:06       ` Paul Menage
2008-05-21  6:06         ` KAMEZAWA Hiroyuki
2008-05-21 13:08         ` Hirokazu Takahashi
2008-05-20  9:09 ` [RFC][PATCH 3/3] memcg: per node information KAMEZAWA Hiroyuki
2008-05-20  9:33   ` Li Zefan
2008-05-20 10:56     ` KAMEZAWA Hiroyuki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48329421.8080904@openvz.org \
    --to=xemul@openvz.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=menage@google.com \
    --cc=yamamoto@valinux.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox