<font size=2 face="sans-serif">Hi Rami,</font>
<br>
<br><font size=2 face="sans-serif">Thank you for the advice. Yes, I will
try using the event handler.</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">18/04/2014 22:38</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><font size=1 color=#5f5f5f face="sans-serif">Sent by:
</font><font size=1 face="sans-serif">kernelnewbies-bounces@kernelnewbies.org</font>
<br>
<hr noshade>
<br>
<br>
<br><font size=3>Hi Hedi,<br>
Well, you can use disabling oom in conjunction with event handler.
Thus, you can free memory by changing memory setting of other cgroups when
an oom occurs in a specific cgroup, and avoid having an oops in that cgroup.<br>
You can see an example of using event handler in conjunction with disabling
the oom killer in <br>
"Namespaces and cgroups in linux", in slides 101/102, see:</font><font size=3 color=blue><u><br>
</u></font><a href=http://ramirose.wix.com/ramirosen><font size=3 color=blue><u>http://ramirose.wix.com/ramirosen</u></font></a>
<p><font size=3>A shameless plug - I wrote this presentation of 121 slides
about namespaces and cgroups.</font>
<p><font size=3>Regards,<br>
Rami Rosen</font>
<p><font size=3>בתאריך 17 באפר 2014 11:24, "Hedi Boufaied"
<</font><a href=mailto:hedi.boufaied@amadeus.com><font size=3 color=blue><u>hedi.boufaied@amadeus.com</u></font></a><font size=3>>
כתב:</font>
<br><font size=3 face="sans-serif">Hi Rami,</font><font size=3> <br>
</font><font size=3 face="sans-serif"><br>
Thanks a lot for your sequence. I followed it and it does work.</font><font size=3>
</font><font size=3 face="sans-serif"><br>
I now see my process paused in sleep state instead of getting killed when
the cgroup reaches OoO.</font><font size=3> <br>
</font><font size=3 face="sans-serif"><br>
This being said:</font><font size=3> </font><font size=3 face="sans-serif"><br>
* I do not really understand why the use_hierarchy option needs to be disabled
in order to allow disabling of the oom killer...</font><font size=3> </font><font size=3 face="sans-serif"><br>
* 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><font size=3>
<br>
</font><font size=3 face="sans-serif"><br>
Best Regards,</font><font size=3> </font><font size=3 face="sans-serif"><br>
Hedi</font><font size=3> <br>
<br>
<br>
</font><font size=1 color=#5f5f5f face="sans-serif"><br>
From: </font><font size=1 face="sans-serif">Rami
Rosen <</font><a href=mailto:roszenrami@gmail.com target=_blank><font size=1 color=blue face="sans-serif"><u>roszenrami@gmail.com</u></font></a><font size=1 face="sans-serif">></font><font size=3>
</font><font size=1 color=#5f5f5f face="sans-serif"><br>
To: </font><font size=1 face="sans-serif">Hedi
Boufaied <</font><a href=mailto:hedi.boufaied@amadeus.com target=_blank><font size=1 color=blue face="sans-serif"><u>hedi.boufaied@amadeus.com</u></font></a><font size=1 face="sans-serif">>,
</font><font size=1 color=#5f5f5f face="sans-serif"><br>
Cc: </font><font size=1 face="sans-serif">kernelnewbies
<</font><a href=mailto:kernelnewbies@kernelnewbies.org target=_blank><font size=1 color=blue face="sans-serif"><u>kernelnewbies@kernelnewbies.org</u></font></a><font size=1 face="sans-serif">></font><font size=3>
</font><font size=1 color=#5f5f5f face="sans-serif"><br>
Date: </font><font size=1 face="sans-serif">15/04/2014
15:39</font><font size=3> </font><font size=1 color=#5f5f5f face="sans-serif"><br>
Subject: </font><font size=1 face="sans-serif">Re:
cgroups: cannot write on file memory.oom_control</font><font size=3> <br>
</font>
<hr noshade><font size=3><br>
<br>
</font><tt><font size=3><br>
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,</font></tt><font size=3 color=blue><u><br>
</u></font><a href="http://lxr.free-electrons.com/source/Documentation/cgroups/memory.txt" target=_blank><tt><font size=3 color=blue><u>http://lxr.free-electrons.com/source/Documentation/cgroups/memory.txt</u></font></tt></a><tt><font size=3>.<br>
<br>
Regards,<br>
Rami Rosen</font></tt><font size=3 color=blue><u><br>
</u></font><a href=http://ramirose.wix.com/ramirosen target=_blank><tt><font size=3 color=blue><u>http://ramirose.wix.com/ramirosen</u></font></tt></a><tt><font size=3><br>
<br>
<br>
<br>
On Mon, Apr 14, 2014 at 12:22 PM, Hedi Boufaied<br>
<</font></tt><a href=mailto:hedi.boufaied@amadeus.com target=_blank><tt><font size=3 color=blue><u>hedi.boufaied@amadeus.com</u></font></tt></a><tt><font size=3>>
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>
> </font></tt><a href=mailto:Kernelnewbies@kernelnewbies.org target=_blank><tt><font size=3 color=blue><u>Kernelnewbies@kernelnewbies.org</u></font></tt></a><tt><font size=3><br>
> </font></tt><a href=http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies target=_blank><tt><font size=3 color=blue><u>http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</u></font></tt></a><tt><font size=3><br>
></font></tt><font size=3><br>
</font><tt><font size=2>_______________________________________________<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>
</font></tt>
<br>