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

libct/cg: support SCHED_IDLE for runc cgroupfs #3377

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

wineway
Copy link
Contributor

@wineway wineway commented Feb 16, 2022

@wineway wineway force-pushed the main branch 3 times, most recently from d06fe5a to f9ca48b Compare May 6, 2022 06:38
@wineway wineway changed the title libct/cg: support SCHED_IDLE for runc libct/cg: support SCHED_IDLE for runc cgroupfs May 6, 2022
@wineway wineway force-pushed the main branch 2 times, most recently from 482bccd to fa7fb14 Compare May 6, 2022 07:06
@wineway wineway marked this pull request as ready for review May 6, 2022 07:10
@wineway
Copy link
Contributor Author

wineway commented May 6, 2022

@kolyshkin PTAL

@wineway wineway mentioned this pull request May 9, 2022
@wineway wineway force-pushed the main branch 2 times, most recently from c918a6c to b108c38 Compare May 11, 2022 10:54
Comment on lines 18 to 22
if r.CpuIdle != nil {
if err := cgroups.WriteFile(dirPath, "cpu.idle", strconv.FormatInt(*r.CpuIdle, 10)); err != nil {
return err
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

You can move this below to after if !isCpuSet(r).

@@ -84,6 +84,10 @@ type Resources struct {
// MEM to use
CpusetMems string `json:"cpuset_mems"`

//nolint:revive
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe instead of ignoring revive warning, call it CPUIdle (hopefully we'll rename the rest of Cpu* fields at some point).

@@ -733,6 +733,7 @@ func CreateCgroupConfig(opts *CreateOpts, defaultDevs []*devices.Device) (*confi
if r.CPU.Quota != nil {
c.Resources.CpuQuota = *r.CPU.Quota
}

Copy link
Contributor

Choose a reason for hiding this comment

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

not needed.

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.

A few nits, plus can you please make the runtime-spec bump a separate commit (for clarity)?

@kolyshkin
Copy link
Contributor

Rebased to fix CI

@wineway
Copy link
Contributor Author

wineway commented May 26, 2022

@kolyshkin Can I ask you to review it again?

@AkihiroSuda
Copy link
Member

Looks good but needs rebase

@AkihiroSuda
Copy link
Member

@wineway Could you rebase?

Signed-off-by: wineway <wangyuweihx@gmail.com>
@wineway
Copy link
Contributor Author

wineway commented Jan 31, 2023

@wineway Could you rebase?

sorry, I missed last comment; rebased

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.

LGTM

@kolyshkin kolyshkin merged commit 32d7413 into opencontainers:main Feb 1, 2023
@cyphar cyphar mentioned this pull request Mar 14, 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.

None yet

3 participants