Skip to content

Commit

Permalink
feat(io.cost): adding rollback method
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Lu <robin.lu@bytedance.com>
  • Loading branch information
lubinszARM committed Mar 6, 2024
1 parent ee7a488 commit 6785ce9
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions pkg/agent/qrm-plugins/io/handlers/iocost/iocost_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ func reportDevicesIOCostVrate(emitter metrics.MetricEmitter) {
}

func disableIOCost(conf *config.Configuration) {
if !conf.EnableSettingIOCost {
general.Infof("IOCostSetting disabled, skip disableIOCost")
if !cgcommon.CheckCgroup2UnifiedMode() {
return
}

Expand Down Expand Up @@ -267,13 +266,12 @@ func SetIOCost(conf *coreconfig.Configuration,
}

// EnableSettingIOCost featuregate.
if !conf.EnableSettingIOCost {
general.Infof("SetIOCost disabled")
return
}

if !conf.EnableSettingIOCostHDDOnly {
general.Infof("SetIOCostHDDOnly disabled. For now, only HDD supported")
if !conf.EnableSettingIOCost || !conf.EnableSettingIOCostHDDOnly {
general.Infof("SetIOCost disabled. For now, only HDD supported.")
// If EnableSettingIOCost was disabled, we should never enable io.cost.
initializeOnce.Do(func() {
disableIOCost(conf)
})
return
}

Expand Down

0 comments on commit 6785ce9

Please sign in to comment.