github.com/kubewharf/katalyst-core@v0.5.3/pkg/agent/qrm-plugins/io/handlers/dirtymem/dirtymem_linux.go (about) 1 //go:build linux 2 // +build linux 3 4 /* 5 Copyright 2022 The Katalyst Authors. 6 7 Licensed under the Apache License, Version 2.0 (the "License"); 8 you may not use this file except in compliance with the License. 9 You may obtain a copy of the License at 10 11 http://www.apache.org/licenses/LICENSE-2.0 12 13 Unless required by applicable law or agreed to in writing, software 14 distributed under the License is distributed on an "AS IS" BASIS, 15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 See the License for the specific language governing permissions and 17 limitations under the License. 18 */ 19 20 package dirtymem 21 22 import ( 23 coreconfig "github.com/kubewharf/katalyst-core/pkg/config" 24 dynamicconfig "github.com/kubewharf/katalyst-core/pkg/config/agent/dynamic" 25 "github.com/kubewharf/katalyst-core/pkg/metaserver" 26 "github.com/kubewharf/katalyst-core/pkg/metrics" 27 "github.com/kubewharf/katalyst-core/pkg/util/general" 28 ) 29 30 func SetDirtyMem(conf *coreconfig.Configuration, 31 _ interface{}, 32 _ *dynamicconfig.DynamicAgentConfiguration, 33 emitter metrics.MetricEmitter, 34 metaServer *metaserver.MetaServer, 35 ) { 36 general.Infof("called") 37 38 if conf == nil { 39 general.Errorf("nil extraConf") 40 return 41 } else if emitter == nil { 42 general.Errorf("nil emitter") 43 return 44 } else if metaServer == nil { 45 general.Errorf("nil metaServer") 46 return 47 } 48 49 // EnableSettingWBT featuregate. 50 if conf.EnableSettingWBT { 51 SetWBTLimit(conf, emitter, metaServer) 52 } 53 }