diff --git a/git-commit b/git-commit index 3881050b7b02b3f6f35e56b0bf9dbf84800bff52..201c2b31d7a16e06e78d16068bd9894889d82124 100644 --- a/git-commit +++ b/git-commit @@ -1 +1 @@ -ba8307fbddb39f7fefd19d8a74f5b99d9851f045 +480f9b7358c97f6513661ba862ff25caa05206b8 diff --git a/patch/0031-runc-fix-update-rt-runtime-us-and-rt-period-us-faile.patch b/patch/0031-runc-fix-update-rt-runtime-us-and-rt-period-us-faile.patch new file mode 100644 index 0000000000000000000000000000000000000000..4d52b133a2b03ac33652f775bc71bc9cbbea3841 --- /dev/null +++ b/patch/0031-runc-fix-update-rt-runtime-us-and-rt-period-us-faile.patch @@ -0,0 +1,48 @@ +From 744a90222c009d1cc42c7b3bc43723d6824f2f80 Mon Sep 17 00:00:00 2001 +From: zhongjiawei +Date: Fri, 20 Oct 2023 16:42:02 +0800 +Subject: [PATCH] runc:fix update rt-runtime-us and rt-period-us failed + +--- + libcontainer/cgroups/fs/cpu.go | 20 +++++++++++++++----- + 1 file changed, 15 insertions(+), 5 deletions(-) + +diff --git a/libcontainer/cgroups/fs/cpu.go b/libcontainer/cgroups/fs/cpu.go +index 6c79f899..0b58781d 100644 +--- a/libcontainer/cgroups/fs/cpu.go ++++ b/libcontainer/cgroups/fs/cpu.go +@@ -35,16 +35,26 @@ func (s *CpuGroup) Apply(path string, r *configs.Resources, pid int) error { + } + + 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 ++var err error ++ if r.CpuRtRuntime != 0 { ++ if err = cgroups.WriteFile(path, "cpu.rt_runtime_us", strconv.FormatInt(r.CpuRtRuntime, 10)); err != nil { ++ if r.CpuRtPeriod != 0 { ++ if err = cgroups.WriteFile(path, "cpu.rt_period_us", strconv.FormatUint(r.CpuRtPeriod, 10)); err != nil { ++ return err ++ } ++ } ++ if err = cgroups.WriteFile(path, "cpu.rt_runtime_us", strconv.FormatInt(r.CpuRtRuntime, 10)); err != nil { ++ return err ++ } ++ return nil + } + } +- if r.CpuRtRuntime != 0 { +- if err := cgroups.WriteFile(path, "cpu.rt_runtime_us", strconv.FormatInt(r.CpuRtRuntime, 10)); err != nil { ++ if r.CpuRtPeriod != 0 { ++ if err = cgroups.WriteFile(path, "cpu.rt_period_us", strconv.FormatUint(r.CpuRtPeriod, 10)); err != nil { + return err + } + } ++ + return nil + } + +-- +2.33.0 + diff --git a/runc.spec b/runc.spec index 291b1b055687319404e2cfc55c7eac62ee4607ef..5ee505182309e03b64a550de53bbb1ea15d6c9d6 100644 --- a/runc.spec +++ b/runc.spec @@ -3,7 +3,7 @@ Name: docker-runc Version: 1.1.8 -Release: 6 +Release: 7 Summary: runc is a CLI tool for spawning and running containers according to the OCI specification. License: ASL 2.0 @@ -54,6 +54,12 @@ install -p -m 755 runc $RPM_BUILD_ROOT/%{_bindir}/runc %{_bindir}/runc %changelog +* Tue Oct 24 2023 zhongjiawei - 1.1.8-7 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix update rt-runtime-us and rt-period-us failed + * Thu Oct 12 2023 zhongjiawei - 1.1.8-6 - Type:bugfix - ID:NA diff --git a/series.conf b/series.conf index 5a4b9131cf045fb03e73dfa42af36b796ba98a02..8160eabe0c2230b24a25ef9ad1507dfb5ec1be8c 100644 --- a/series.conf +++ b/series.conf @@ -27,3 +27,4 @@ patch/0027-runc-libct-fix-shared-pidns-detection.patch patch/0028-runc-nsenter-cloned_binary-remove-bindfd-logic-entirely.patch patch/0029-runc-libct-init-unify-init-fix-its-error-logic.patch patch/0030-runc-Handle-kmem.limit_in_bytes-removal.patch +patch/0031-runc-fix-update-rt-runtime-us-and-rt-period-us-faile.patch