memcg: correct RESOURCE_MAX to ULLONG_MAX
authorSha Zhengju <[email protected]>
Thu, 12 Sep 2013 22:13:46 +0000 (15:13 -0700)
committerLinus Torvalds <[email protected]>
Thu, 12 Sep 2013 22:38:02 +0000 (15:38 -0700)
Current RESOURCE_MAX is ULONG_MAX, but the value we used to set resource
limit is unsigned long long, so we can set bigger value than that which is
strange.  The XXX_MAX should be reasonable max value, bigger than that
should be overflow.

Notice that this change will affect user output of default *.limit_in_bytes:
before change:

  $ cat /cgroup/memory/memory.limit_in_bytes
  9223372036854775807

after change:

  $ cat /cgroup/memory/memory.limit_in_bytes
  18446744073709551615

But it doesn't alter the API in term of input - we can still use "echo -1
> *.limit_in_bytes" to reset the numbers to "unlimited".

Signed-off-by: Sha Zhengju <[email protected]>
Signed-off-by: Qiang Huang <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Daisuke Nishimura <[email protected]>
Cc: Jeff Liu <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/res_counter.h

index 96a509b6be04eeaceecad4b6cc03d8d5ea60e451..586bc7cb1dcf4e904a3791b6d0bc76badcb46da0 100644 (file)
@@ -54,7 +54,7 @@ struct res_counter {
        struct res_counter *parent;
 };
 
-#define RESOURCE_MAX (unsigned long long)LLONG_MAX
+#define RESOURCE_MAX ULLONG_MAX
 
 /**
  * Helpers to interact with userspace