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

set the default value of CpuBurst to nil instead of 0 #4211

Merged
merged 2 commits into from
Apr 10, 2024

Conversation

lifubang
Copy link
Member

@lifubang lifubang commented Mar 3, 2024

Fix #4210

We should set the default of CpuBurst to nil instead of 0 when we are updating a container's resource limit.

@lifubang lifubang requested a review from kolyshkin March 3, 2024 13:55
@lifubang lifubang force-pushed the fix-update-cpu-burst branch 3 times, most recently from ef2c491 to dda00b4 Compare March 3, 2024 14:21
update.go Outdated
@@ -216,7 +215,6 @@ other options are ignored.
opt string
dest *uint64
}{
{"cpu-burst", r.CPU.Burst},
{"cpu-period", r.CPU.Period},
{"cpu-rt-period", r.CPU.RealtimePeriod},
{"cpu-share", r.CPU.Shares},
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we distinguish nil from zero for all the fields?

See c9ba576

Copy link
Member Author

@lifubang lifubang Mar 4, 2024

Choose a reason for hiding this comment

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

Yes, I think we should deal with all this type fields. Could you please provide your PR link?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

ping @lifubang @kolyshkin PTAL

Copy link
Member Author

Choose a reason for hiding this comment

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

cherry-picked from your PR and add a testcase.

@lifubang lifubang force-pushed the fix-update-cpu-burst branch 2 times, most recently from de4e7a4 to 7823197 Compare March 15, 2024 11:47
@lifubang lifubang force-pushed the fix-update-cpu-burst branch 2 times, most recently from 74f4f7a to 9172684 Compare March 15, 2024 16:02
@lifubang lifubang mentioned this pull request Mar 17, 2024
@kolyshkin
Copy link
Contributor

Is this currently a draft @lifubang ?

@rata
Copy link
Member

rata commented Apr 3, 2024

@lifubang friendly ping? :)

lifubang and others added 2 commits April 4, 2024 00:56
In issue opencontainers#4210, if we don't provide `--cpu-burst` in `runc update`,
the value of cpu burst will always set to 0.

Signed-off-by: lifubang <[email protected]>
Prior to this commit, commands like `runc update --cpuset-cpus=1`
were implying to set cpu burst to "0" (which does not mean "leave it as is").

This was failing when the kernel does not support cpu burst:
`openat2 /sys/fs/cgroup/runc-cgroups-integration-test/test-cgroup-22167/cpu.max.burst: no such file or directory`

Signed-off-by: Akihiro Suda <[email protected]>
@lifubang
Copy link
Member Author

lifubang commented Apr 3, 2024

@kolyshkin How about merge this to fix the CpuBurst issue first?

@rata
Copy link
Member

rata commented Apr 4, 2024

I can confirm containerd tests pass now with this PR: https://github.com/containerd/containerd/actions/runs/8555412932/job/23442925228?pr=9313

@AkihiroSuda AkihiroSuda requested a review from a team April 9, 2024 01:24
Copy link
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

This is not totally right in my view, and also a tad overcomplicated, but it fixes a real bug, and a proper solution requires changes to cgroup managers.

Thus LGTM.

@AkihiroSuda AkihiroSuda merged commit f2bd184 into opencontainers:main Apr 10, 2024
45 checks passed
@lifubang lifubang deleted the fix-update-cpu-burst branch April 10, 2024 09:56
@lifubang lifubang mentioned this pull request Jun 10, 2024
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 update will clear cpu burst value
4 participants