Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9079199

Browse files
committed
skip set cpu.weight when cpu.idle is enabled in cgroups v2
Signed-off-by: axb <uaxb@hotmail.com>
1 parent99f7fa1 commit9079199

File tree

1 file changed

+2
-1
lines changed
  • libcontainer/cgroups/fs2

1 file changed

+2
-1
lines changed

‎libcontainer/cgroups/fs2/cpu.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ func setCpu(dirPath string, r *configs.Resources) error {
2929
}
3030

3131
// NOTE: .CpuShares is not used here. Conversion is the caller's responsibility.
32-
ifr.CpuWeight!=0 {
32+
// can not set cpu.weight if cpu.idle is enabled
33+
ifr.CpuWeight!=0&& (r.CPUIdle==nil||*r.CPUIdle==0) {
3334
iferr:=cgroups.WriteFile(dirPath,"cpu.weight",strconv.FormatUint(r.CpuWeight,10));err!=nil {
3435
returnerr
3536
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp