I'm running CentOS 7 with kernel
I use cgroups to apply a memory limit on processes. During rolling restart of the application the memory limit is doubled to accommodate the memory needs.
However sometimes after the restart it's not possible to lower the swap memory limit to the original value and cgroup returns an error
write error: Device or resource busy
[root@us app]# echo "643825664" > memory.limit_in_bytes [root@us app]# echo "673825664" > memory.memsw.limit_in_bytes -bash: echo: write error: Device or resource busy [root@us app]# echo "873825664" > memory.memsw.limit_in_bytes [root@us app]#
Writing a bigger value (such as +200MB) seems to work ok.
I haven't figured out why this happens. I didn't find anything in the cgroup documentation which would refer to this error. I assume it has to do something with the current swap usage being higher than the limit.
Do you have any experience with such errors?