<font size=2 face="sans-serif">Hi Rami,</font>
<br>
<br><font size=2 face="sans-serif">Thanks a lot for your sequence. I followed
it and it does work.</font>
<br><font size=2 face="sans-serif">I now see my process paused in sleep
state instead of getting killed when the cgroup reaches OoO.</font>
<br>
<br><font size=2 face="sans-serif">This being said:</font>
<br><font size=2 face="sans-serif">* I do not really understand why the
use_hierarchy option needs to be disabled in order to allow disabling of
the oom killer...</font>
<br><font size=2 face="sans-serif">* I'm not sure that disabling the OoO
killer is safe/reliable enough: in some of the trials I made, I saw other
processes (xterms) not part of the OoO cgroup getting completely stuck
and I had to reboot my machine...</font>
<br>
<br><font size=2 face="sans-serif">Best Regards,</font>
<br><font size=2 face="sans-serif">Hedi</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From:
</font><font size=1 face="sans-serif">Rami Rosen <roszenrami@gmail.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">To:
</font><font size=1 face="sans-serif">Hedi Boufaied <hedi.boufaied@amadeus.com>,
</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Cc:
</font><font size=1 face="sans-serif">kernelnewbies <kernelnewbies@kernelnewbies.org></font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date:
</font><font size=1 face="sans-serif">15/04/2014 15:39</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject:
</font><font size=1 face="sans-serif">Re: cgroups:
cannot write on file memory.oom_control</font>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>Hi, Hedi,<br>
<br>
This sequence works for me:<br>
<br>
echo 0 > /sys/fs/cgroup/memory/memory.use_hierarchy<br>
<br>
mkdir /sys/fs/cgroup/memory/0<br>
<br>
Then, the following two commands changes the value of oom_kill_disable:<br>
<br>
echo 1 > /sys/fs/cgroup/memory/0/memory.oom_control<br>
<br>
echo 0 > /sys/fs/cgroup/memory/0/memory.oom_control<br>
<br>
<br>
For more info, please look for the text about enabling/disabling<br>
use_hierarchy in section 6,<br>
</font></tt><a href="http://lxr.free-electrons.com/source/Documentation/cgroups/memory.txt"><tt><font size=2>http://lxr.free-electrons.com/source/Documentation/cgroups/memory.txt</font></tt></a><tt><font size=2>.<br>
<br>
Regards,<br>
Rami Rosen<br>
</font></tt><a href=http://ramirose.wix.com/ramirosen><tt><font size=2>http://ramirose.wix.com/ramirosen</font></tt></a><tt><font size=2><br>
<br>
<br>
<br>
On Mon, Apr 14, 2014 at 12:22 PM, Hedi Boufaied<br>
<hedi.boufaied@amadeus.com> wrote:<br>
> Hi everyone,<br>
><br>
> I am working with cgroups on OpenSuse (over VirtualBox) and I cannot
disable<br>
> the OOM killer by writing to the file memory.oom_control:<br>
><br>
>> echo 1 > memory.oom_control<br>
>> -bash: echo: write error: Invalid argument<br>
><br>
> I can change the memory limit and several other settings by writing
to the<br>
> appropriate files (like memory.limit_in_bytes) but I could never write
to<br>
> file memory.oom_control although I am root.<br>
><br>
> I saw someone posted a similar issue a few days ago but there was
no<br>
> reply...<br>
><br>
> I have copied below the sequence of command I am using. Any idea what
could<br>
> be the issue ?<br>
><br>
> Thanks in advance for your help!<br>
><br>
> Hedi<br>
><br>
><br>
> ----<br>
><br>
> /sys/fs> su - root<br>
><br>
> /sys/fs> cd cgroup<br>
><br>
> /sys/fs/cgroup> cgcreate -g memory:/mygroup<br>
><br>
> /sys/fs/cgroup> cd memory/mygroup<br>
><br>
> /sys/fs/cgroup/memory/mygroup> echo 32M > memory.limit_in_bytes<br>
><br>
> /sys/fs/cgroup/memory/mygroup> cat memory.limit_in_bytes<br>
> 33554432<br>
><br>
> /sys/fs/cgroup/memory/mygroup> echo 1 > memory.oom_control<br>
> -bash: echo: write error: Invalid argument<br>
><br>
> /sys/fs/cgroup/memory/mygroup> cat memory.oom_control<br>
> oom_kill_disable 0<br>
> under_oom 0<br>
><br>
> ---<br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> Kernelnewbies@kernelnewbies.org<br>
> </font></tt><a href=http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies><tt><font size=2>http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</font></tt></a><tt><font size=2><br>
><br>
</font></tt>
<br>