Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cgroup-resources,cgroupv2: allow setting memory.swap.max to 0 #1241

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

flouthoc
Copy link
Collaborator

@flouthoc flouthoc commented Jul 5, 2023

Runc accepts 0 value of swap from config as an exception case

As per the documentation here: https://facebookmicrosites.github.io/cgroup2/docs/memory-controller.html#using-swap Setting memory.swap.max to 0 is treated as swap being disabled hence allow crun to do the same.

Closes: #1001

Runc accepts `0` value of `swap` from config as an exception case
* See: https://github.com/opencontainers/runc/blob/main/libcontainer/cgroups/fs2/memory.go#L36
* See: https://github.com/opencontainers/runc/blob/main/libcontainer/cgroups/utils.go#L431

As per the documentation here: https://facebookmicrosites.github.io/cgroup2/docs/memory-controller.html#using-swap
Setting `memory.swap.max` to `0` is treated as `swap` being disabled
hence allow `crun` to do the same.

Closes: containers#1001

Signed-off-by: Aditya R <arajan@redhat.com>
@flouthoc flouthoc marked this pull request as draft July 5, 2023 07:58
@flouthoc
Copy link
Collaborator Author

flouthoc commented Jul 5, 2023

Failing fedora-rawhide-mockbuild is unrelated to this PR and was also seen here: #1240

@flouthoc flouthoc marked this pull request as ready for review July 5, 2023 08:25
@flouthoc flouthoc marked this pull request as draft July 5, 2023 08:25
@flouthoc flouthoc marked this pull request as ready for review July 5, 2023 08:48
@giuseppe
Copy link
Member

giuseppe commented Jul 5, 2023

@kolyshkin @AkihiroSuda PTAL

@rhatdan
Copy link
Member

rhatdan commented Jul 26, 2023

LGTM
@flouthoc @giuseppe @kolyshkin @AkihiroSuda Ready for release?

@flouthoc flouthoc requested a review from kolyshkin July 27, 2023 04:35
@flouthoc flouthoc mentioned this pull request Jul 27, 2023
@giuseppe giuseppe merged commit bafc327 into containers:main Jul 27, 2023
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

runc incompatibility: cannot set swap limit without the memory limit
4 participants