All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: nishimura@mxp.nes.nec.co.jp
Cc: d-nishimura@mtf.biglobe.ne.jp, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, lizf@cn.fujitsu.com,
	balbir@linux.vnet.ibm.com, kamezawa.hiroyu@jp.fujitsu.com,
	menage@google.com
Subject: Re: [PATCH mmotm] memcg: add interface to reset limits
Date: Fri, 5 Jun 2009 13:20:31 -0700	[thread overview]
Message-ID: <20090605132031.02f79021.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090605222245.6920061a.d-nishimura@mtf.biglobe.ne.jp>

On Fri, 5 Jun 2009 22:22:45 +0900
Daisuke Nishimura <d-nishimura@mtf.biglobe.ne.jp> wrote:

> We don't have interface to reset mem.limit or memsw.limit now.
> 
> This patch allows to reset mem.limit or memsw.limit when they are
> being set to -1.
> 
> ...
>
> @@ -133,6 +133,16 @@ int res_counter_memparse_write_strategy(const char *buf,
>  					unsigned long long *res)
>  {
>  	char *end;
> +
> +	/* return RESOURCE_MAX(unlimited) if "-1" is specified */
> +	if (*buf == '-') {
> +		*res = simple_strtoull(buf + 1, &end, 10);
> +		if (*res != 1 || *end != '\0')
> +			return -EINVAL;
> +		*res = RESOURCE_MAX;
> +		return 0;
> +	}

The test for (*end != '\0') would be unneeded if strict_strtoull() had
been used.


> +
>  	/* FIXME - make memparse() take const char* args */
>  	*res = memparse((char *)buf, &end);
>  	if (*end != '\0')

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: nishimura@mxp.nes.nec.co.jp
Cc: d-nishimura@mtf.biglobe.ne.jp, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, lizf@cn.fujitsu.com,
	balbir@linux.vnet.ibm.com, kamezawa.hiroyu@jp.fujitsu.com,
	menage@google.com
Subject: Re: [PATCH mmotm] memcg: add interface to reset limits
Date: Fri, 5 Jun 2009 13:20:31 -0700	[thread overview]
Message-ID: <20090605132031.02f79021.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090605222245.6920061a.d-nishimura@mtf.biglobe.ne.jp>

On Fri, 5 Jun 2009 22:22:45 +0900
Daisuke Nishimura <d-nishimura@mtf.biglobe.ne.jp> wrote:

> We don't have interface to reset mem.limit or memsw.limit now.
> 
> This patch allows to reset mem.limit or memsw.limit when they are
> being set to -1.
> 
> ...
>
> @@ -133,6 +133,16 @@ int res_counter_memparse_write_strategy(const char *buf,
>  					unsigned long long *res)
>  {
>  	char *end;
> +
> +	/* return RESOURCE_MAX(unlimited) if "-1" is specified */
> +	if (*buf == '-') {
> +		*res = simple_strtoull(buf + 1, &end, 10);
> +		if (*res != 1 || *end != '\0')
> +			return -EINVAL;
> +		*res = RESOURCE_MAX;
> +		return 0;
> +	}

The test for (*end != '\0') would be unneeded if strict_strtoull() had
been used.


> +
>  	/* FIXME - make memparse() take const char* args */
>  	*res = memparse((char *)buf, &end);
>  	if (*end != '\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:[~2009-06-05 20:21 UTC|newest]

Thread overview: 26+ 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:45 ` Daisuke Nishimura
2009-06-03  2:49 ` [PATCH mmotm 1/2] memcg: add interface to reset limits Daisuke Nishimura
2009-06-03  2:49   ` Daisuke Nishimura
2009-06-03  3:54   ` KAMEZAWA Hiroyuki
2009-06-03  3:54     ` KAMEZAWA Hiroyuki
2009-06-03  5:16   ` Li Zefan
2009-06-03  5:16     ` Li Zefan
2009-06-03  5:43     ` Daisuke Nishimura
2009-06-03  5:43       ` Daisuke Nishimura
2009-06-05 13:22       ` [PATCH mmotm] " Daisuke Nishimura
2009-06-05 13:22         ` Daisuke Nishimura
2009-06-05 20:20         ` Andrew Morton [this message]
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  2:50   ` Daisuke Nishimura
2009-06-03  3:52   ` KAMEZAWA Hiroyuki
2009-06-03  3:52     ` KAMEZAWA Hiroyuki
2009-06-03  5:01     ` Daisuke Nishimura
2009-06-03  5:01       ` Daisuke Nishimura
2009-06-03  8:20       ` KAMEZAWA Hiroyuki
2009-06-03  8:20         ` KAMEZAWA Hiroyuki
2009-06-03  8:46       ` KAMEZAWA Hiroyuki
2009-06-03  8:46         ` KAMEZAWA Hiroyuki
2009-06-04  4:31         ` Daisuke Nishimura
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=20090605132031.02f79021.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=d-nishimura@mtf.biglobe.ne.jp \
    --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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.