Documentation ¶
Index ¶
- Constants
- Variables
- func BlkIOUpdateFunc(resource ResourceUpdater) error
- func CgroupUpdateCPUSharesFunc(resource ResourceUpdater) error
- func CgroupUpdateWithUnlimitedFunc(resource ResourceUpdater) error
- func CheckIfBlkQOSNeedUpdate(oldValue string, newValue string) bool
- func CheckIfBlkRootConfigNeedUpdate(oldValue string, newValue string) bool
- func CommonCgroupUpdateFunc(resource ResourceUpdater) error
- func CommonDefaultUpdateFunc(resource ResourceUpdater) error
- func IsCgroupDirErr(err error) bool
- func IsCgroupPathExist(parentDir string, r sysutil.Resource) (bool, string)
- func MergeConditionIfCPUSetIsLooser(oldValue, newValue string) (string, bool, error)
- func MergeConditionIfValueIsLarger(oldValue, newValue string) (string, bool, error)
- func ResourceCgroupDirErr(msg string) error
- func UpdateResctrlSchemataFunc(u ResourceUpdater) error
- func UpdateResctrlTasksFunc(resource ResourceUpdater) error
- type CgroupReader
- type CgroupResourceUpdater
- func (u *CgroupResourceUpdater) Clone() ResourceUpdater
- func (u *CgroupResourceUpdater) GetLastUpdateTimestamp() time.Time
- func (u *CgroupResourceUpdater) GeteventHelper() *audit.EventHelper
- func (u *CgroupResourceUpdater) Key() string
- func (u *CgroupResourceUpdater) MergeUpdate() (ResourceUpdater, error)
- func (u *CgroupResourceUpdater) Path() string
- func (u *CgroupResourceUpdater) ResourceType() sysutil.ResourceType
- func (u *CgroupResourceUpdater) SetUpdateFunc(updateFunc UpdateFunc, mergeUpdateFunc MergeUpdateFunc)
- func (u *CgroupResourceUpdater) SeteventHelper(a *audit.EventHelper)
- func (u *CgroupResourceUpdater) UpdateLastUpdateTimestamp(time time.Time)
- func (u *CgroupResourceUpdater) Value() string
- type CgroupUpdaterFactoryImpl
- type CgroupV1Reader
- func (r *CgroupV1Reader) ReadCPUAcctUsage(parentDir string) (uint64, error)
- func (r *CgroupV1Reader) ReadCPUPeriod(parentDir string) (int64, error)
- func (r *CgroupV1Reader) ReadCPUQuota(parentDir string) (int64, error)
- func (r *CgroupV1Reader) ReadCPUSet(parentDir string) (*cpuset.CPUSet, error)
- func (r *CgroupV1Reader) ReadCPUShares(parentDir string) (int64, error)
- func (r *CgroupV1Reader) ReadCPUStat(parentDir string) (*sysutil.CPUStatRaw, error)
- func (r *CgroupV1Reader) ReadCPUTasks(parentDir string) ([]int32, error)
- func (r *CgroupV1Reader) ReadMemoryLimit(parentDir string) (int64, error)
- func (r *CgroupV1Reader) ReadMemoryNumaStat(parentDir string) ([]sysutil.NumaMemoryPages, error)
- func (r *CgroupV1Reader) ReadMemoryStat(parentDir string) (*sysutil.MemoryStatRaw, error)
- func (r *CgroupV1Reader) ReadPSI(parentDir string) (*PSIByResource, error)
- type CgroupV2Reader
- func (r *CgroupV2Reader) ReadCPUAcctUsage(parentDir string) (uint64, error)
- func (r *CgroupV2Reader) ReadCPUPeriod(parentDir string) (int64, error)
- func (r *CgroupV2Reader) ReadCPUQuota(parentDir string) (int64, error)
- func (r *CgroupV2Reader) ReadCPUSet(parentDir string) (*cpuset.CPUSet, error)
- func (r *CgroupV2Reader) ReadCPUShares(parentDir string) (int64, error)
- func (r *CgroupV2Reader) ReadCPUStat(parentDir string) (*sysutil.CPUStatRaw, error)
- func (r *CgroupV2Reader) ReadCPUTasks(parentDir string) ([]int32, error)
- func (r *CgroupV2Reader) ReadMemoryLimit(parentDir string) (int64, error)
- func (r *CgroupV2Reader) ReadMemoryNumaStat(parentDir string) ([]sysutil.NumaMemoryPages, error)
- func (r *CgroupV2Reader) ReadMemoryStat(parentDir string) (*sysutil.MemoryStatRaw, error)
- func (r *CgroupV2Reader) ReadPSI(parentDir string) (*PSIByResource, error)
- type Config
- type DefaultResourceUpdater
- func (u *DefaultResourceUpdater) Clone() ResourceUpdater
- func (u *DefaultResourceUpdater) GetLastUpdateTimestamp() time.Time
- func (u *DefaultResourceUpdater) Key() string
- func (u *DefaultResourceUpdater) MergeUpdate() (ResourceUpdater, error)
- func (u *DefaultResourceUpdater) Path() string
- func (u *DefaultResourceUpdater) ResourceType() sysutil.ResourceType
- func (u *DefaultResourceUpdater) UpdateLastUpdateTimestamp(time time.Time)
- func (u *DefaultResourceUpdater) Value() string
- type GuestCgroupResourceUpdater
- type MergeConditionFunc
- type MergeUpdateFunc
- type NewResourceUpdaterFunc
- type PSIByResource
- type PSILine
- type PSIPath
- type PSIStats
- type ResctrlSchemataResourceUpdater
- type ResourceUpdateExecutor
- type ResourceUpdateExecutorImpl
- func (e *ResourceUpdateExecutorImpl) LeveledUpdateBatch(updaters [][]ResourceUpdater)
- func (e *ResourceUpdateExecutorImpl) Run(stopCh <-chan struct{})
- func (e *ResourceUpdateExecutorImpl) Update(cacheable bool, resource ResourceUpdater) (bool, error)
- func (e *ResourceUpdateExecutorImpl) UpdateBatch(cacheable bool, updaters ...ResourceUpdater)
- type ResourceUpdater
- func CalculateResctrlL3TasksResource(group string, taskIds []int32) (ResourceUpdater, error)
- func MergeFuncUpdateCgroup(resource ResourceUpdater, mergeCondition MergeConditionFunc) (ResourceUpdater, error)
- func NewBlkIOResourceUpdater(resourceType sysutil.ResourceType, parentDir string, value string, ...) (ResourceUpdater, error)
- func NewCPUSharesCgroupUpdater(resourceType sysutil.ResourceType, parentDir string, value string, ...) (ResourceUpdater, error)
- func NewCgroupUpdater(resourceType sysutil.ResourceType, parentDir string, value string, ...) (ResourceUpdater, error)
- func NewCommonCgroupUpdater(resourceType sysutil.ResourceType, parentDir string, value string, ...) (ResourceUpdater, error)
- func NewCommonDefaultUpdater(key string, file string, value string, e *audit.EventHelper) (ResourceUpdater, error)
- func NewCommonDefaultUpdaterWithUpdateFunc(key string, file string, value string, updateFunc UpdateFunc, ...) (ResourceUpdater, error)
- func NewDetailCgroupUpdater(resource sysutil.Resource, parentDir string, value string, ...) (ResourceUpdater, error)
- func NewMergeableCgroupUpdaterIfCPUSetLooser(resourceType sysutil.ResourceType, parentDir string, value string, ...) (ResourceUpdater, error)
- func NewMergeableCgroupUpdaterIfValueLarger(resourceType sysutil.ResourceType, parentDir string, value string, ...) (ResourceUpdater, error)
- func NewMergeableCgroupUpdaterWithCondition(resourceType sysutil.ResourceType, parentDir string, value string, ...) (ResourceUpdater, error)
- func NewResctrlL3SchemataResource(group, schemataDelta string, l3Num int) ResourceUpdater
- func NewResctrlMbSchemataResource(group, schemataDelta string, l3Num int) ResourceUpdater
- func NewUnlimitedCgroupUpdater(resourceType sysutil.ResourceType, parentDir string, value string, ...) (ResourceUpdater, error)
- type ResourceUpdaterFactory
- type UpdateFunc
Constants ¶
const ( // CgroupMaxSymbolStr only appears in cgroups-v2 files, we consider the value as MaxInt64 CgroupMaxSymbolStr string = "max" // CgroupMaxValueStr math.MaxInt64; writing `memory.high` with this do the same as set as "max" CgroupMaxValueStr string = "9223372036854775807" )
const ( ReasonUpdateCgroups = "UpdateCgroups" ReasonUpdateSystemConfig = "UpdateSystemConfig" ReasonUpdateResctrl = "UpdateResctrl" // update resctrl tasks, schemata EvictPodByNodeMemoryUsage = "EvictPodByNodeMemoryUsage" EvictPodByBECPUSatisfaction = "EvictPodByBECPUSatisfaction" AdjustBEByNodeCPUUsage = "AdjustBEByNodeCPUUsage" )
const EmptyValueError string = "EmptyValueError"
const ErrCgroupDir = "cgroup path or file not exist"
Variables ¶
var Conf = NewDefaultConfig()
var DefaultCgroupUpdaterFactory = NewCgroupUpdaterFactory()
var ErrResourceNotRegistered = errors.New("resource not registered")
Functions ¶
func BlkIOUpdateFunc ¶ added in v1.3.0
func BlkIOUpdateFunc(resource ResourceUpdater) error
func CgroupUpdateCPUSharesFunc ¶
func CgroupUpdateCPUSharesFunc(resource ResourceUpdater) error
func CgroupUpdateWithUnlimitedFunc ¶
func CgroupUpdateWithUnlimitedFunc(resource ResourceUpdater) error
func CheckIfBlkQOSNeedUpdate ¶ added in v1.3.0
blkio.cost.weight: configure iocost weight blkio.throttle.read_bps_device: configure read bps blkio.throttle.read_iops_device: configure read iops blkio.throttle.write_bps_device: configure write bps blkio.throttle.write_iops_device: configure write iops
func CheckIfBlkRootConfigNeedUpdate ¶ added in v1.3.0
func CommonCgroupUpdateFunc ¶
func CommonCgroupUpdateFunc(resource ResourceUpdater) error
func CommonDefaultUpdateFunc ¶
func CommonDefaultUpdateFunc(resource ResourceUpdater) error
func IsCgroupDirErr ¶ added in v1.2.0
func IsCgroupPathExist ¶ added in v1.2.0
func MergeConditionIfCPUSetIsLooser ¶
MergeConditionIfCPUSetIsLooser returns a merge condition where only do update when the new cpuset value is looser.
func MergeConditionIfValueIsLarger ¶
MergeConditionIfValueIsLarger returns a merge condition where only do update when the new value is larger.
func ResourceCgroupDirErr ¶ added in v1.2.0
func UpdateResctrlSchemataFunc ¶
func UpdateResctrlSchemataFunc(u ResourceUpdater) error
func UpdateResctrlTasksFunc ¶
func UpdateResctrlTasksFunc(resource ResourceUpdater) error
Types ¶
type CgroupReader ¶
type CgroupReader interface { ReadCPUQuota(parentDir string) (int64, error) ReadCPUPeriod(parentDir string) (int64, error) ReadCPUSet(parentDir string) (*cpuset.CPUSet, error) ReadCPUAcctUsage(parentDir string) (uint64, error) ReadCPUStat(parentDir string) (*sysutil.CPUStatRaw, error) ReadMemoryLimit(parentDir string) (int64, error) ReadMemoryStat(parentDir string) (*sysutil.MemoryStatRaw, error) ReadMemoryNumaStat(parentDir string) ([]sysutil.NumaMemoryPages, error) ReadCPUTasks(parentDir string) ([]int32, error) ReadPSI(parentDir string) (*PSIByResource, error) }
func NewCgroupReader ¶
func NewCgroupReader() CgroupReader
type CgroupResourceUpdater ¶
type CgroupResourceUpdater struct {
// contains filtered or unexported fields
}
func (*CgroupResourceUpdater) Clone ¶
func (u *CgroupResourceUpdater) Clone() ResourceUpdater
func (*CgroupResourceUpdater) GetLastUpdateTimestamp ¶
func (u *CgroupResourceUpdater) GetLastUpdateTimestamp() time.Time
func (*CgroupResourceUpdater) GeteventHelper ¶ added in v1.2.0
func (u *CgroupResourceUpdater) GeteventHelper() *audit.EventHelper
func (*CgroupResourceUpdater) Key ¶
func (u *CgroupResourceUpdater) Key() string
func (*CgroupResourceUpdater) MergeUpdate ¶
func (u *CgroupResourceUpdater) MergeUpdate() (ResourceUpdater, error)
func (*CgroupResourceUpdater) Path ¶
func (u *CgroupResourceUpdater) Path() string
func (*CgroupResourceUpdater) ResourceType ¶
func (u *CgroupResourceUpdater) ResourceType() sysutil.ResourceType
func (*CgroupResourceUpdater) SetUpdateFunc ¶
func (u *CgroupResourceUpdater) SetUpdateFunc(updateFunc UpdateFunc, mergeUpdateFunc MergeUpdateFunc)
func (*CgroupResourceUpdater) SeteventHelper ¶ added in v1.2.0
func (u *CgroupResourceUpdater) SeteventHelper(a *audit.EventHelper)
func (*CgroupResourceUpdater) UpdateLastUpdateTimestamp ¶
func (u *CgroupResourceUpdater) UpdateLastUpdateTimestamp(time time.Time)
func (*CgroupResourceUpdater) Value ¶
func (u *CgroupResourceUpdater) Value() string
type CgroupUpdaterFactoryImpl ¶
type CgroupUpdaterFactoryImpl struct {
// contains filtered or unexported fields
}
func (*CgroupUpdaterFactoryImpl) New ¶
func (f *CgroupUpdaterFactoryImpl) New(resourceType sysutil.ResourceType, parentDir string, value string, e *audit.EventHelper) (ResourceUpdater, error)
func (*CgroupUpdaterFactoryImpl) Register ¶
func (f *CgroupUpdaterFactoryImpl) Register(g NewResourceUpdaterFunc, resourceTypes ...sysutil.ResourceType)
type CgroupV1Reader ¶
type CgroupV1Reader struct{}
func (*CgroupV1Reader) ReadCPUAcctUsage ¶
func (r *CgroupV1Reader) ReadCPUAcctUsage(parentDir string) (uint64, error)
func (*CgroupV1Reader) ReadCPUPeriod ¶
func (r *CgroupV1Reader) ReadCPUPeriod(parentDir string) (int64, error)
func (*CgroupV1Reader) ReadCPUQuota ¶
func (r *CgroupV1Reader) ReadCPUQuota(parentDir string) (int64, error)
func (*CgroupV1Reader) ReadCPUSet ¶
func (r *CgroupV1Reader) ReadCPUSet(parentDir string) (*cpuset.CPUSet, error)
func (*CgroupV1Reader) ReadCPUShares ¶
func (r *CgroupV1Reader) ReadCPUShares(parentDir string) (int64, error)
func (*CgroupV1Reader) ReadCPUStat ¶
func (r *CgroupV1Reader) ReadCPUStat(parentDir string) (*sysutil.CPUStatRaw, error)
func (*CgroupV1Reader) ReadCPUTasks ¶
func (r *CgroupV1Reader) ReadCPUTasks(parentDir string) ([]int32, error)
func (*CgroupV1Reader) ReadMemoryLimit ¶
func (r *CgroupV1Reader) ReadMemoryLimit(parentDir string) (int64, error)
func (*CgroupV1Reader) ReadMemoryNumaStat ¶ added in v1.2.0
func (r *CgroupV1Reader) ReadMemoryNumaStat(parentDir string) ([]sysutil.NumaMemoryPages, error)
func (*CgroupV1Reader) ReadMemoryStat ¶
func (r *CgroupV1Reader) ReadMemoryStat(parentDir string) (*sysutil.MemoryStatRaw, error)
func (*CgroupV1Reader) ReadPSI ¶ added in v1.2.0
func (r *CgroupV1Reader) ReadPSI(parentDir string) (*PSIByResource, error)
type CgroupV2Reader ¶
type CgroupV2Reader struct{}
func (*CgroupV2Reader) ReadCPUAcctUsage ¶
func (r *CgroupV2Reader) ReadCPUAcctUsage(parentDir string) (uint64, error)
func (*CgroupV2Reader) ReadCPUPeriod ¶
func (r *CgroupV2Reader) ReadCPUPeriod(parentDir string) (int64, error)
func (*CgroupV2Reader) ReadCPUQuota ¶
func (r *CgroupV2Reader) ReadCPUQuota(parentDir string) (int64, error)
func (*CgroupV2Reader) ReadCPUSet ¶
func (r *CgroupV2Reader) ReadCPUSet(parentDir string) (*cpuset.CPUSet, error)
func (*CgroupV2Reader) ReadCPUShares ¶
func (r *CgroupV2Reader) ReadCPUShares(parentDir string) (int64, error)
func (*CgroupV2Reader) ReadCPUStat ¶
func (r *CgroupV2Reader) ReadCPUStat(parentDir string) (*sysutil.CPUStatRaw, error)
func (*CgroupV2Reader) ReadCPUTasks ¶
func (r *CgroupV2Reader) ReadCPUTasks(parentDir string) ([]int32, error)
func (*CgroupV2Reader) ReadMemoryLimit ¶
func (r *CgroupV2Reader) ReadMemoryLimit(parentDir string) (int64, error)
func (*CgroupV2Reader) ReadMemoryNumaStat ¶ added in v1.2.0
func (r *CgroupV2Reader) ReadMemoryNumaStat(parentDir string) ([]sysutil.NumaMemoryPages, error)
func (*CgroupV2Reader) ReadMemoryStat ¶
func (r *CgroupV2Reader) ReadMemoryStat(parentDir string) (*sysutil.MemoryStatRaw, error)
func (*CgroupV2Reader) ReadPSI ¶ added in v1.2.0
func (r *CgroupV2Reader) ReadPSI(parentDir string) (*PSIByResource, error)
type Config ¶
type Config struct {
ResourceForceUpdateSeconds int
}
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
type DefaultResourceUpdater ¶
type DefaultResourceUpdater struct {
// contains filtered or unexported fields
}
func (*DefaultResourceUpdater) Clone ¶
func (u *DefaultResourceUpdater) Clone() ResourceUpdater
func (*DefaultResourceUpdater) GetLastUpdateTimestamp ¶
func (u *DefaultResourceUpdater) GetLastUpdateTimestamp() time.Time
func (*DefaultResourceUpdater) Key ¶
func (u *DefaultResourceUpdater) Key() string
func (*DefaultResourceUpdater) MergeUpdate ¶
func (u *DefaultResourceUpdater) MergeUpdate() (ResourceUpdater, error)
func (*DefaultResourceUpdater) Path ¶
func (u *DefaultResourceUpdater) Path() string
func (*DefaultResourceUpdater) ResourceType ¶
func (u *DefaultResourceUpdater) ResourceType() sysutil.ResourceType
func (*DefaultResourceUpdater) UpdateLastUpdateTimestamp ¶
func (u *DefaultResourceUpdater) UpdateLastUpdateTimestamp(time time.Time)
func (*DefaultResourceUpdater) Value ¶
func (u *DefaultResourceUpdater) Value() string
type GuestCgroupResourceUpdater ¶
type GuestCgroupResourceUpdater struct { *CgroupResourceUpdater // contains filtered or unexported fields }
type MergeConditionFunc ¶
type MergeUpdateFunc ¶
type MergeUpdateFunc func(resource ResourceUpdater) (ResourceUpdater, error)
type NewResourceUpdaterFunc ¶
type NewResourceUpdaterFunc func(resourceType sysutil.ResourceType, parentDir string, value string, e *audit.EventHelper) (ResourceUpdater, error)
type PSIByResource ¶ added in v1.2.0
type ResctrlSchemataResourceUpdater ¶
type ResctrlSchemataResourceUpdater struct { DefaultResourceUpdater // contains filtered or unexported fields }
func (*ResctrlSchemataResourceUpdater) Clone ¶
func (r *ResctrlSchemataResourceUpdater) Clone() ResourceUpdater
func (*ResctrlSchemataResourceUpdater) Key ¶
func (r *ResctrlSchemataResourceUpdater) Key() string
type ResourceUpdateExecutor ¶
type ResourceUpdateExecutor interface { Update(cacheable bool, updater ResourceUpdater) (updated bool, err error) UpdateBatch(cacheable bool, updaters ...ResourceUpdater) // LeveledUpdateBatch is to cacheable update resources by the order of resources' level. // For cgroup interfaces like `cpuset.cpus` and `memory.min`, reconciliation from top to bottom should keep the // upper value larger/broader than the lower. Thus a Leveled updater is implemented as follows: // 1. update batch of cgroup resources group by cgroup interface, i.e. cgroup filename. // 2. update each cgroup resource by the order of layers: firstly update resources from upper to lower by merging // the new value with old value; then update resources from lower to upper with the new value. LeveledUpdateBatch(updaters [][]ResourceUpdater) Run(stopCh <-chan struct{}) }
func NewResourceUpdateExecutor ¶
func NewResourceUpdateExecutor() ResourceUpdateExecutor
type ResourceUpdateExecutorImpl ¶
type ResourceUpdateExecutorImpl struct { LeveledUpdateLock sync.Mutex ResourceCache *cache.Cache Config *Config // contains filtered or unexported fields }
func (*ResourceUpdateExecutorImpl) LeveledUpdateBatch ¶
func (e *ResourceUpdateExecutorImpl) LeveledUpdateBatch(updaters [][]ResourceUpdater)
func (*ResourceUpdateExecutorImpl) Run ¶
func (e *ResourceUpdateExecutorImpl) Run(stopCh <-chan struct{})
Run runs the ResourceUpdateExecutor. TODO: run single executor when the qos manager starts.
func (*ResourceUpdateExecutorImpl) Update ¶
func (e *ResourceUpdateExecutorImpl) Update(cacheable bool, resource ResourceUpdater) (bool, error)
Update updates the resources with the given cacheable attribute with the cacheable attribute directly.
func (*ResourceUpdateExecutorImpl) UpdateBatch ¶
func (e *ResourceUpdateExecutorImpl) UpdateBatch(cacheable bool, updaters ...ResourceUpdater)
UpdateBatch updates a batch of resources with the given cacheable attribute. TODO: merge and resolve conflicts of batch updates from multiple callers.
type ResourceUpdater ¶
type ResourceUpdater interface { ResourceType() sysutil.ResourceType Key() string Path() string Value() string MergeUpdate() (ResourceUpdater, error) Clone() ResourceUpdater GetLastUpdateTimestamp() time.Time UpdateLastUpdateTimestamp(time time.Time) // contains filtered or unexported methods }
func CalculateResctrlL3TasksResource ¶
func CalculateResctrlL3TasksResource(group string, taskIds []int32) (ResourceUpdater, error)
func MergeFuncUpdateCgroup ¶
func MergeFuncUpdateCgroup(resource ResourceUpdater, mergeCondition MergeConditionFunc) (ResourceUpdater, error)
func NewBlkIOResourceUpdater ¶ added in v1.3.0
func NewBlkIOResourceUpdater(resourceType sysutil.ResourceType, parentDir string, value string, e *audit.EventHelper) (ResourceUpdater, error)
func NewCPUSharesCgroupUpdater ¶
func NewCPUSharesCgroupUpdater(resourceType sysutil.ResourceType, parentDir string, value string, e *audit.EventHelper) (ResourceUpdater, error)
func NewCgroupUpdater ¶
func NewCgroupUpdater(resourceType sysutil.ResourceType, parentDir string, value string, updateFunc UpdateFunc, e *audit.EventHelper) (ResourceUpdater, error)
func NewCommonCgroupUpdater ¶
func NewCommonCgroupUpdater(resourceType sysutil.ResourceType, parentDir string, value string, e *audit.EventHelper) (ResourceUpdater, error)
NewCommonCgroupUpdater returns a CgroupResourceUpdater for updating known cgroup resources.
func NewCommonDefaultUpdater ¶
func NewCommonDefaultUpdater(key string, file string, value string, e *audit.EventHelper) (ResourceUpdater, error)
NewCommonDefaultUpdater returns a DefaultResourceUpdater for update general files.
func NewCommonDefaultUpdaterWithUpdateFunc ¶
func NewCommonDefaultUpdaterWithUpdateFunc(key string, file string, value string, updateFunc UpdateFunc, e *audit.EventHelper) (ResourceUpdater, error)
NewCommonDefaultUpdaterWithUpdateFunc returns a DefaultResourceUpdater for update general files with the given update function.
func NewDetailCgroupUpdater ¶
func NewDetailCgroupUpdater(resource sysutil.Resource, parentDir string, value string, updateFunc UpdateFunc, e *audit.EventHelper) (ResourceUpdater, error)
NewDetailCgroupUpdater returns a new *CgroupResourceUpdater according to the given Resource, which is generally used for backwards compatibility. It is not guaranteed for updating successfully since it does not retrieve from the known cgroup resources.
func NewMergeableCgroupUpdaterIfCPUSetLooser ¶
func NewMergeableCgroupUpdaterIfCPUSetLooser(resourceType sysutil.ResourceType, parentDir string, value string, e *audit.EventHelper) (ResourceUpdater, error)
func NewMergeableCgroupUpdaterIfValueLarger ¶
func NewMergeableCgroupUpdaterIfValueLarger(resourceType sysutil.ResourceType, parentDir string, value string, e *audit.EventHelper) (ResourceUpdater, error)
func NewMergeableCgroupUpdaterWithCondition ¶
func NewMergeableCgroupUpdaterWithCondition(resourceType sysutil.ResourceType, parentDir string, value string, mergeCondition MergeConditionFunc, e *audit.EventHelper) (ResourceUpdater, error)
func NewResctrlL3SchemataResource ¶
func NewResctrlL3SchemataResource(group, schemataDelta string, l3Num int) ResourceUpdater
func NewResctrlMbSchemataResource ¶
func NewResctrlMbSchemataResource(group, schemataDelta string, l3Num int) ResourceUpdater
func NewUnlimitedCgroupUpdater ¶
func NewUnlimitedCgroupUpdater(resourceType sysutil.ResourceType, parentDir string, value string, e *audit.EventHelper) (ResourceUpdater, error)
type ResourceUpdaterFactory ¶
type ResourceUpdaterFactory interface { Register(g NewResourceUpdaterFunc, resourceTypes ...sysutil.ResourceType) New(resourceType sysutil.ResourceType, parentDir string, value string, e *audit.EventHelper) (ResourceUpdater, error) }
func NewCgroupUpdaterFactory ¶
func NewCgroupUpdaterFactory() ResourceUpdaterFactory
type UpdateFunc ¶
type UpdateFunc func(resource ResourceUpdater) error