google/lmctfy — pull request #9 by abhishekrai (2013-10-28 06:39:51+00:00)
Title: Replace kint64max with -1 for limit_in_bytes.

The kernel rejects kint64max values with EINVAL on 3.8.0-19 when
writing to "memory.limit_in_bytes". It accepts values up to
(kint64max & ~(PAGE_SIZE-1)). My suspicion is that when lmctfy passes
kint64max, somewhere its being parsed as an int64 and also being
aligned to the next page boundary. This is not surprising given
that I can reproduce this without lmctfy also --

echo 9223372036854775807 >/dev/cgroup/memory/test/memory.limit_in_bytes
bash: echo: write error: Invalid argument

It seems that -1 is the proper way of telling the kernel to set
max limit (from looking at mem_cgroup_write() in memcontrol.cc and
Documentation/cgroups/memory.txt).

echo -1 >/dev/cgroup/memory/test/memory.limit_in_bytes
cat /dev/cgroup/memory/test/memory.limit_in_bytes
9223372036854775807