Skip to content

Commit 662ac7f

Browse files
authored
Merge pull request #1001 from boblee0717/bob_cv1
should find all sub cgroup and set to -1 incase new sub cgroup, close v1 cfs quota
2 parents 7ada70d + 59515d3 commit 662ac7f

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

pkg/agent/qrm-plugins/cpu/dynamicpolicy/policy_advisor_handler.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -759,9 +759,6 @@ func (p *DynamicPolicy) applyAllContainersQuota(pod *v1.Pod, setToLimit bool) er
759759
return fmt.Errorf("ApplyCPUWithRelativePath %s to %v failed with error: %v", relativePath, realQuota, err)
760760
}
761761
} else {
762-
if containerCpu.CpuQuota < 0 {
763-
continue
764-
}
765762
err := p.applyAllSubCgroupQuotaToUnLimit(relativePath)
766763
if err != nil {
767764
return fmt.Errorf("applyAllSubCgroupQuotaToUnLimit %s failed with error: %v", relativePath, err)

pkg/agent/utilcomponent/featuregatenegotiation/finders/feature_cpu/quota_ctrl_knob.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"github.com/kubewharf/katalyst-core/pkg/agent/qrm-plugins/advisorsvc"
2121
"github.com/kubewharf/katalyst-core/pkg/agent/utilcomponent/featuregatenegotiation/finders"
2222
"github.com/kubewharf/katalyst-core/pkg/config"
23+
"github.com/kubewharf/katalyst-core/pkg/util/cgroup/common"
2324
"github.com/kubewharf/katalyst-core/pkg/util/general"
2425
)
2526

@@ -28,7 +29,7 @@ const NegotiationFeatureGateQuotaCtrlKnob = "feature_gate_quota_ctrl_knob"
2829
type QuotaCtrlKnob struct{}
2930

3031
func (e *QuotaCtrlKnob) GetFeatureGate(conf *config.Configuration) *advisorsvc.FeatureGate {
31-
if conf.EnableControlKnobCPUQuota == false {
32+
if conf.EnableControlKnobCPUQuota == false || !common.CheckCgroup2UnifiedMode() {
3233
general.Infof("feature_gate_quota_ctrl_knob is not supported: %v", conf.EnableControlKnobCPUQuota)
3334
return nil
3435
}

0 commit comments

Comments
 (0)