[slurm-users] cgroup swap limit cgroups v2
hedrick at rutgers.edu
Sat Aug 26 19:41:10 UTC 2023
It appears that when you set AllowedSwapSpace in cgroups.conf, this percent is added to the requested memory amount. So to set memoryswapmax to 0, you have to set AllowedSwapSpace to -100. Arithmetic is imprecise and parts seem to use signed float, so you can get unexpected results. I'm actually going to use -99 to be safe.
The addition makes sense with cgroups v1, because it is setting a limit to memory+swap. It makes no sense to set that lower than memory. But for cgroups v2, you are setting just swap. So to get the same result as v1, you need to set AllowedSwapSpace to the value from v1 - 100 (if v1 does what I think -- I don't have a v1 system to try it on.)
I also suggest that ManagedOOMMemoryPressure=kill should be set on slurmstepd.scope, or memory limits may not do anything. There is some other magic that may also be necessary.
In general OOM handling with cgroups v2 is complex and badly documented. It's hard to know just what is going to happen. slurm add another level of partially documented complexity.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the slurm-users