cgroups: cannot write on file memory.oom_control

Hedi Boufaied hedi.boufaied at amadeus.com
Thu Apr 17 04:24:05 EDT 2014


Hi Rami,

Thanks a lot for your sequence. I followed it and it does work.
I now see my process paused in sleep state instead of getting killed when 
the cgroup reaches OoO.

This being said:
* I do not really understand why the use_hierarchy option needs to be 
disabled in order to allow disabling of the oom killer...
* 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...

Best Regards,
Hedi



From:   Rami Rosen <roszenrami at gmail.com>
To:     Hedi Boufaied <hedi.boufaied at amadeus.com>, 
Cc:     kernelnewbies <kernelnewbies at kernelnewbies.org>
Date:   15/04/2014 15:39
Subject:        Re: cgroups: cannot write on file memory.oom_control



Hi, Hedi,

This sequence works for me:

echo 0 >  /sys/fs/cgroup/memory/memory.use_hierarchy

mkdir  /sys/fs/cgroup/memory/0

Then, the following two commands changes the value of oom_kill_disable:

echo 1 >   /sys/fs/cgroup/memory/0/memory.oom_control

echo 0 >   /sys/fs/cgroup/memory/0/memory.oom_control


For more info, please look for the text about enabling/disabling
use_hierarchy in section 6,
http://lxr.free-electrons.com/source/Documentation/cgroups/memory.txt.

Regards,
Rami Rosen
http://ramirose.wix.com/ramirosen



On Mon, Apr 14, 2014 at 12:22 PM, Hedi Boufaied
<hedi.boufaied at amadeus.com> wrote:
> Hi everyone,
>
> I am working with cgroups on OpenSuse (over VirtualBox) and I cannot 
disable
> the OOM killer by writing to the file memory.oom_control:
>
>> echo 1 > memory.oom_control
>> -bash: echo: write error: Invalid argument
>
> I can change the memory limit and several other settings by writing to 
the
> appropriate files (like memory.limit_in_bytes) but I could never write 
to
> file memory.oom_control although I am root.
>
> I saw someone posted a similar issue a few days ago but there was no
> reply...
>
> I have copied below the sequence of command I am using. Any idea what 
could
> be the issue ?
>
> Thanks in advance for your help!
>
> Hedi
>
>
> ----
>
> /sys/fs> su - root
>
> /sys/fs> cd cgroup
>
> /sys/fs/cgroup> cgcreate -g memory:/mygroup
>
> /sys/fs/cgroup> cd memory/mygroup
>
> /sys/fs/cgroup/memory/mygroup> echo 32M > memory.limit_in_bytes
>
> /sys/fs/cgroup/memory/mygroup> cat memory.limit_in_bytes
> 33554432
>
> /sys/fs/cgroup/memory/mygroup> echo 1 > memory.oom_control
> -bash: echo: write error: Invalid argument
>
> /sys/fs/cgroup/memory/mygroup> cat memory.oom_control
> oom_kill_disable 0
> under_oom 0
>
> ---
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140417/e9e72db0/attachment.html 


More information about the Kernelnewbies mailing list