lkml.org 
[lkml]   [2009]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH mmotm] memcg: add interface to reset limits
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')


\
 
 \ /
  Last update: 2009-06-05 22:25    [W:0.053 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site