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

cri: make swapping disabled with memory limit #7783

Merged
merged 1 commit into from Dec 13, 2022

Conversation

mqasimsarfraz
Copy link
Contributor

@mqasimsarfraz mqasimsarfraz commented Dec 8, 2022

OCI runtime spec defines memory.swap as 'limit of memory+Swap usage' so setting them to equal should disable the swap (limits for cgroup v1). Also, this change should make containerd behaviour same as other runtimes e.g cri-dockerd/dockershim and won't be impacted when user turn on 'NodeSwap' (kubernetes/enhancements#2400) feature.

We hit this issue in environment where swap was enabled and containerd created container wasn't getting killed with OOM unlike other runtimes.

Fixes #7749

Signed-off-by: Qasim Sarfraz qasimsarfraz@microsoft.com

@k8s-ci-robot
Copy link

Hi @mqasimsarfraz. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@fuweid fuweid added the area/cri Container Runtime Interface (CRI) label Dec 8, 2022
OCI runtime spec defines memory.swap as 'limit of memory+Swap usage'
so setting them to equal should disable the swap. Also, this change
should make containerd behaviour same as other runtimes e.g
'cri-dockerd/dockershim' and won't be impacted when user turn on
'NodeSwap' (kubernetes/enhancements#2400) feature.

Signed-off-by: Qasim Sarfraz <qasimsarfraz@microsoft.com>
@mxpv
Copy link
Member

mxpv commented Dec 8, 2022

/test pull-containerd-sandboxed-node-e2e

@fuweid fuweid added the cherry-pick/1.6.x Change to be cherry picked to release/1.6 branch label Dec 11, 2022
Copy link
Member

@dcantah dcantah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.. LGTM

Copy link
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@estesp estesp merged commit ecf00ff into containerd:main Dec 13, 2022
@fuweid fuweid added cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch cherry-picked/sbserver Changes are backported to sbserver and removed cherry-pick/1.6.x Change to be cherry picked to release/1.6 branch labels Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cri Container Runtime Interface (CRI) cherry-picked/sbserver Changes are backported to sbserver cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch impact/changelog needs-ok-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CRI] Swap should be disabled by default if user sets a memory limit
6 participants