diff --git a/runsc/cgroup/cgroup_v2.go b/runsc/cgroup/cgroup_v2.go index 658e288681..a2b27d27ed 100644 --- a/runsc/cgroup/cgroup_v2.go +++ b/runsc/cgroup/cgroup_v2.go @@ -298,19 +298,21 @@ func createCgroupConfigFromResources(name string, r *specs.LinuxResources) (*lib if r.BlockIO.LeafWeight != nil { c.Resources.BlkioLeafWeight = *r.BlockIO.LeafWeight } - if r.BlockIO.WeightDevice != nil { - for _, wd := range r.BlockIO.WeightDevice { - var weight, leafWeight uint16 - if wd.Weight != nil { - weight = *wd.Weight - } - if wd.LeafWeight != nil { - leafWeight = *wd.LeafWeight - } - weightDevice := libcontainerconfigs.NewWeightDevice(wd.Major, wd.Minor, weight, leafWeight) - c.Resources.BlkioWeightDevice = append(c.Resources.BlkioWeightDevice, weightDevice) - } - } + // FIXME: enable blkio weight. Currently it's setting wrong value + // https://github.com/opencontainers/runc/pull/2786 + // if r.BlockIO.WeightDevice != nil { + // for _, wd := range r.BlockIO.WeightDevice { + // var weight, leafWeight uint16 + // if wd.Weight != nil { + // weight = *wd.Weight + // } + // if wd.LeafWeight != nil { + // leafWeight = *wd.LeafWeight + // } + // weightDevice := libcontainerconfigs.NewWeightDevice(wd.Major, wd.Minor, weight, leafWeight) + // c.Resources.BlkioWeightDevice = append(c.Resources.BlkioWeightDevice, weightDevice) + // } + // } if r.BlockIO.ThrottleReadBpsDevice != nil { for _, td := range r.BlockIO.ThrottleReadBpsDevice { rate := td.Rate diff --git a/test/root/cgroup_test.go b/test/root/cgroup_test.go index bc32b62c73..419bef2144 100644 --- a/test/root/cgroup_test.go +++ b/test/root/cgroup_test.go @@ -379,13 +379,15 @@ func TestCgroupV2(t *testing.T) { want: fmt.Sprintf("%d", 1<<31-1<<30), skipIfNotFound: true, // swap may be disabled on the machine. }, - { - field: "blkio-weight", - value: 750, - file: "io.bfq.weight", - want: fmt.Sprintf("%d", libcontainercgroups.ConvertBlkIOToCgroupV2Value(750)), - skipIfNotFound: true, // blkio groups may not be available. - }, + // FIXME: enable blkio weight. Currently it's setting wrong value, see + // https://github.com/opencontainers/runc/pull/2786 + // { + // field: "blkio-weight", + // value: 750, + // file: "io.bfq.weight", + // want: fmt.Sprintf("%d", libcontainercgroups.ConvertBlkIOToCgroupV2Value(750)), + // skipIfNotFound: true, // blkio groups may not be available. + // }, { field: "pids-limit", value: 1000,