Linux Container Development
 help / color / mirror / Atom feed
From: Li Zefan <lizf-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
To: anqin <anqin.qin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Linux Containers
	<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
Subject: Re: No limitation in physical memory in cgroups
Date: Wed, 20 May 2009 15:05:44 +0800	[thread overview]
Message-ID: <4A13ABC8.2000907@cn.fujitsu.com> (raw)
In-Reply-To: <d95d44a20905192252t6cce5169y730a37184075beb9-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

anqin wrote:
> Hi all,
> 
> I would like to bind given physical memory to specific task group,
> however it does not take effect in my experiments. Are there
> something wrong in my experiments.
> 
> My experiment is done under the kernel 2.6.29.3 and I constructed
> my task group by following commands:
> 
> a) In shell #1, prepare a bash :
> 
> # bash
> # echo $$
> 2253
> 

The pid of shell #1 is 2253.

> b) In shell #2, prepare the memory control via cgroupfs:
> 
> # mount -t cgroup cgroup /mnt/mycgrp
> # cd /mn/mycgrp
> # mkdir mycontainer
> # echo 0 > mycontainer/cpuset.mems
> # echo 0-1 > mycontainer/cpuset.cpus
> # echo 2252 > mycontainer/tasks
> 

but this is 2252 !!

> # cat mycontainer/memory.usage_in_bytes
> 2875392
> # echo 3000000 > mycontainer/memory.max_usage_in_bytes
> # cat mycontainer/memory.max_usage_in_bytes
> 3002368
> 
> 
> c) In Shell #1, run a memory consumer (in which, malloc() is called
> to allocate memory and not free until program is existed) to allocate
> 500M memory:
> 
> # /tmp/memoy_consumer_program  500
> 
> In Shell #2, the used memory ascends from start point 2875392 when
> program begins (from number presented in memory.usage_in_bytes),
> but it return to start point when it touches the maximal boundary.
> 
> On the other hand, I also run the top to watch the memory hold by
> memoy_consumer_program. In top, the memory (both virtual and rss
> memory ) is always growing without any limitation.
> 
> Is this phenomenon the correct behaviors of memory cgroups?
> 
> 
> Best Regards,

  parent reply	other threads:[~2009-05-20  7:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-20  5:52 No limitation in physical memory in cgroups anqin
     [not found] ` <d95d44a20905192252t6cce5169y730a37184075beb9-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-20  6:30   ` Daisuke Nishimura
     [not found]     ` <20090520153055.fe753b89.nishimura-YQH0OdQVrdy45+QrQBaojngSJqDPrsil@public.gmane.org>
2009-05-20  6:54       ` anqin
2009-05-20  7:05   ` Li Zefan [this message]
     [not found]     ` <4A13ABC8.2000907-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2009-05-20 10:35       ` anqin
     [not found]         ` <d95d44a20905200335v6aabfc28qa3958e8404965775-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-20 23:58           ` KAMEZAWA Hiroyuki
     [not found]             ` <20090521085857.d4b82cba.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2009-05-21  6:47               ` anqin
     [not found]                 ` <d95d44a20905202347y177e9744k1a9817236a102b53-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-21  7:15                   ` KAMEZAWA Hiroyuki
     [not found]                     ` <20090521161556.2eca8fd0.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2009-05-21 11:56                       ` anqin
     [not found]                         ` <d95d44a20905210456q13b2334avecb0dc6ff0f0d26-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-21 15:18                           ` Balbir Singh
     [not found]                             ` <20090521151848.GQ4858-SINUvgVNF2CyUtPGxGje5AC/G2K4zDHf@public.gmane.org>
2009-05-22  2:31                               ` anqin
     [not found]                                 ` <d95d44a20905211931v3918b5d3p79d47225963c81f3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-22  2:56                                   ` KAMEZAWA Hiroyuki
     [not found]                                     ` <20090522115622.30cb514a.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2009-05-22  9:25                                       ` anqin
2009-05-20 13:59   ` Balbir Singh
     [not found]     ` <20090520135944.GL4858-SINUvgVNF2CyUtPGxGje5AC/G2K4zDHf@public.gmane.org>
2009-05-20 15:01       ` anqin

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=4A13ABC8.2000907@cn.fujitsu.com \
    --to=lizf-bthxqxjhjhxqfuhtdcdx3a@public.gmane.org \
    --cc=anqin.qin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    /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