From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: LKML <linux-kernel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
Balbir Singh <balbir@linux.vnet.ibm.com>,
Li Zefan <lizf@cn.fujitsu.com>, Paul Menage <menage@google.com>
Subject: Re: [PATCH mmotm 1/2] memcg: add interface to reset limits
Date: Wed, 3 Jun 2009 12:54:06 +0900 [thread overview]
Message-ID: <20090603125406.fd5a2ef2.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <20090603114908.52c3aed5.nishimura@mxp.nes.nec.co.jp>
On Wed, 3 Jun 2009 11:49:08 +0900
Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> wrote:
> Setting mem.limit or memsw.limit to 0 has no meaning
> in actual use(no process can run in such condition).
>
> We don't have interface to reset mem.limit or memsw.limit now,
> so let's reset the mem.limit or memsw.limit to default(unlimited)
> when they are being set to 0.
>
Maybe good. But when I proposed this kind of patch, it was rejected.
(try to add RES_ININITY)
please wait acks from others.
But from me,
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujits.ucom>
> Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
> ---
> Documentation/cgroups/memory.txt | 1 +
> include/linux/res_counter.h | 2 ++
> kernel/res_counter.c | 2 +-
> mm/memcontrol.c | 2 ++
> 4 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
> index 1a60887..e1c69f3 100644
> --- a/Documentation/cgroups/memory.txt
> +++ b/Documentation/cgroups/memory.txt
> @@ -204,6 +204,7 @@ We can alter the memory limit:
>
> NOTE: We can use a suffix (k, K, m, M, g or G) to indicate values in kilo,
> mega or gigabytes.
> +NOTE: We can write "0" to reset the *.limit_in_bytes(unlimited).
>
> # cat /cgroups/0/memory.limit_in_bytes
> 4194304
> diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h
> index 4c5bcf6..511f42f 100644
> --- a/include/linux/res_counter.h
> +++ b/include/linux/res_counter.h
> @@ -49,6 +49,8 @@ struct res_counter {
> struct res_counter *parent;
> };
>
> +#define RESOURCE_MAX (unsigned long long)LLONG_MAX
> +
> /**
> * Helpers to interact with userspace
> * res_counter_read_u64() - returns the value of the specified member.
> diff --git a/kernel/res_counter.c b/kernel/res_counter.c
> index bf8e753..0a45778 100644
> --- a/kernel/res_counter.c
> +++ b/kernel/res_counter.c
> @@ -18,7 +18,7 @@
> void res_counter_init(struct res_counter *counter, struct res_counter *parent)
> {
> spin_lock_init(&counter->lock);
> - counter->limit = (unsigned long long)LLONG_MAX;
> + counter->limit = RESOURCE_MAX;
> counter->parent = parent;
> }
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index a83e039..6629ed2 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -2040,6 +2040,8 @@ static int mem_cgroup_write(struct cgroup *cont, struct cftype *cft,
> ret = res_counter_memparse_write_strategy(buffer, &val);
> if (ret)
> break;
> + if (!val)
> + val = RESOURCE_MAX;
> if (type == _MEM)
> ret = mem_cgroup_resize_limit(memcg, val);
> else
>
--
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>
next prev parent reply other threads:[~2009-06-03 16:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-03 2:45 [PATCH mmotm 0/2] memcg: changes to *.limit_in_bytes Daisuke Nishimura
2009-06-03 2:49 ` [PATCH mmotm 1/2] memcg: add interface to reset limits Daisuke Nishimura
2009-06-03 3:54 ` KAMEZAWA Hiroyuki [this message]
2009-06-03 5:16 ` Li Zefan
2009-06-03 5:43 ` Daisuke Nishimura
2009-06-05 13:22 ` [PATCH mmotm] " Daisuke Nishimura
2009-06-05 20:20 ` Andrew Morton
2009-06-03 2:50 ` [PATCH mmotm 2/2] memcg: allow mem.limit bigger than memsw.limit iff unlimited Daisuke Nishimura
2009-06-03 3:52 ` KAMEZAWA Hiroyuki
2009-06-03 5:01 ` Daisuke Nishimura
2009-06-03 8:20 ` KAMEZAWA Hiroyuki
2009-06-03 8:46 ` KAMEZAWA Hiroyuki
2009-06-04 4:31 ` Daisuke Nishimura
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=20090603125406.fd5a2ef2.kamezawa.hiroyu@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lizf@cn.fujitsu.com \
--cc=menage@google.com \
--cc=nishimura@mxp.nes.nec.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