opencontainers / runtime-spec

OCI Runtime Specification
http://www.opencontainers.org
Apache License 2.0
3.19k stars 541 forks source link

config-linux: Should we clarify when should we set the swap limit? #1215

Closed mqasimsarfraz closed 1 year ago

mqasimsarfraz commented 1 year ago

I have seen it multiple times now that setting swap limit w/o swap controller can lead to issues. For example:

Based on the above, I was wondering if it makes sense to clarify that memory swap limit MUST only be set if the controller is available? Just wanted to open an issue to understand if it makes sense to document it in runtime-spec? If yes, then I will be happy to open a PR!

utam0k commented 1 year ago

I don't think the runtime spec has to take care of this case since other controllers also may be unavailable. Therefore, that definition would require us to write a non-existent case for other things as well. They are a matter of judgment on the part of the implementation to make the appropriate error or not.

mqasimsarfraz commented 1 year ago

I don't think the runtime spec has to take care of this case since other controllers also may be unavailable. Therefore, that definition would require us to write a non-existent case for other things as well.

Good point.

They are a matter of judgment on the part of the implementation to make the appropriate error or not.

I agree it should be on the implementation side. Nonetheless, after seeing it in multiple scenarios and runc returning an error about it, I was wondering for the best way to document it.

Anyways, thanks for the response. I will go ahead and close the issue!