-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
Description
For example:
- When the updated cpu-rt-runtime value becomes smaller and the cpu-rt-period value also becomes smaller, the update is unsuccessful.
(1)when creating a container, set the parameters to: --cpu-rt-runtime 950000 --cpu-rt-period 1000000.
(2)If the update parameters are --cpu-rt-runtime 5000 --cpu-rt-period 960000, runc cannot successfully updated。It will report an error: Invalid parameter
The reason is that in the SetRtSched function of runc, the cpu-rt-period value is written first and then the cpu-rt-runtime value. If the cpu-rt-period value is written without complying with the cgroup rules, an error will be reported and returned directly.
func (s *CpuGroup) SetRtSched(path string, r *configs.Resources) error {
if r.CpuRtPeriod != 0 {
if err := cgroups.WriteFile(path, "cpu.rt_period_us", strconv.FormatUint(r.CpuRtPeriod, 10)); err != nil {
return err
}
}
if r.CpuRtRuntime != 0 {
if err := cgroups.WriteFile(path, "cpu.rt_runtime_us", strconv.FormatInt(r.CpuRtRuntime, 10)); err != nil {
return err
}
}
return nil
}Describe the results you received and expected
runc successfully updated
What version of runc are you using?
runc version 1.1.3
commit: v1.1.3-0-g6724737f-dirty
spec: 1.0.2-dev
go: go1.20.8
libseccomp: 2.5.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels