Skip to content

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 [email protected]

@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.

Details

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.

@mqasimsarfraz mqasimsarfraz force-pushed the qasim/cri-disable-swap branch from cc5d6a6 to 8a1c5e7 Compare December 8, 2022 11:01
@fuweid fuweid added the area/cri Container Runtime Interface (CRI) label Dec 8, 2022
@mqasimsarfraz mqasimsarfraz force-pushed the qasim/cri-disable-swap branch from 8a1c5e7 to c68ffd1 Compare December 8, 2022 12:00
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 <[email protected]>
@mqasimsarfraz mqasimsarfraz force-pushed the qasim/cri-disable-swap branch from c68ffd1 to 69975b9 Compare December 8, 2022 12:55
@mxpv
Copy link
Member

mxpv commented Dec 8, 2022

/test pull-containerd-sandboxed-node-e2e

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

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