Skip to content

Commit

Permalink
support LLC & MBA isolation (#94)
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Liu <jasonliu747@gmail.com>
  • Loading branch information
jasonliu747 committed Apr 29, 2022
1 parent 1a83fb3 commit dd30303
Show file tree
Hide file tree
Showing 29 changed files with 3,074 additions and 318 deletions.
36 changes: 31 additions & 5 deletions apis/slo/v1alpha1/nodeslo_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ type MemoryQoSCfg struct {
}

type ResourceQoS struct {
MemoryQoS *MemoryQoSCfg `json:"memoryQoS,omitempty"`
MemoryQoS *MemoryQoSCfg `json:"memoryQoS,omitempty"`
ResctrlQoS *ResctrlQoSCfg `json:"resctrlQoS,omitempty"`
}

type ResourceQoSStrategy struct {
Expand Down Expand Up @@ -151,17 +152,42 @@ type ResourceThresholdStrategy struct {
MemoryEvictLowerPercent *int64 `json:"memoryEvictLowerPercent,omitempty"`
}

// ResctrlQoSCfg stores node-level config of resctrl qos
type ResctrlQoSCfg struct {
// Enable indicates whether the resctrl qos is enabled.
Enable *bool `json:"enable,omitempty"`
ResctrlQoS `json:",inline"`
}

type ResctrlQoS struct {
// LLC available range start for pods by percentage
// +kubebuilder:default=0
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=100
CATRangeStartPercent *int64 `json:"catRangeStartPercent,omitempty"`
// LLC available range end for pods by percentage
// +kubebuilder:default=100
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=100
CATRangeEndPercent *int64 `json:"catRangeEndPercent,omitempty"`
// MBA percent
// +kubebuilder:default=100
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=100
MBAPercent *int64 `json:"mbaPercent,omitempty"`
}

type CPUBurstPolicy string

const (
// disable cpu burst policy
CPUBurstNone = "none"
CPUBurstNone CPUBurstPolicy = "none"
// only enable cpu burst policy by setting cpu.cfs_burst_us
CPUBurstOnly = "cpuBurstOnly"
CPUBurstOnly CPUBurstPolicy = "cpuBurstOnly"
// only enable cfs quota burst policy by scale up cpu.cfs_quota_us if pod throttled
CFSQuotaBurstOnly = "cfsQuotaBurstOnly"
CFSQuotaBurstOnly CPUBurstPolicy = "cfsQuotaBurstOnly"
// enable both
CPUBurstAuto = "auto"
CPUBurstAuto CPUBurstPolicy = "auto"
)

type CPUBurstConfig struct {
Expand Down
56 changes: 56 additions & 0 deletions apis/slo/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

150 changes: 150 additions & 0 deletions config/crd/bases/slo.koordinator.sh_nodeslos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,36 @@ spec:
format: int64
type: integer
type: object
resctrlQoS:
description: ResctrlQoSCfg stores node-level config of resctrl
qos
properties:
catRangeEndPercent:
default: 100
description: LLC available range end for pods by percentage
format: int64
maximum: 100
minimum: 0
type: integer
catRangeStartPercent:
default: 0
description: LLC available range start for pods by percentage
format: int64
maximum: 100
minimum: 0
type: integer
enable:
description: Enable indicates whether the resctrl qos
is enabled.
type: boolean
mbaPercent:
default: 100
description: MBA percent
format: int64
maximum: 100
minimum: 0
type: integer
type: object
type: object
cgroupRoot:
description: ResourceQoS for root cgroup.
Expand Down Expand Up @@ -259,6 +289,36 @@ spec:
format: int64
type: integer
type: object
resctrlQoS:
description: ResctrlQoSCfg stores node-level config of resctrl
qos
properties:
catRangeEndPercent:
default: 100
description: LLC available range end for pods by percentage
format: int64
maximum: 100
minimum: 0
type: integer
catRangeStartPercent:
default: 0
description: LLC available range start for pods by percentage
format: int64
maximum: 100
minimum: 0
type: integer
enable:
description: Enable indicates whether the resctrl qos
is enabled.
type: boolean
mbaPercent:
default: 100
description: MBA percent
format: int64
maximum: 100
minimum: 0
type: integer
type: object
type: object
ls:
description: ResourceQoS for LS pods.
Expand Down Expand Up @@ -355,6 +415,36 @@ spec:
format: int64
type: integer
type: object
resctrlQoS:
description: ResctrlQoSCfg stores node-level config of resctrl
qos
properties:
catRangeEndPercent:
default: 100
description: LLC available range end for pods by percentage
format: int64
maximum: 100
minimum: 0
type: integer
catRangeStartPercent:
default: 0
description: LLC available range start for pods by percentage
format: int64
maximum: 100
minimum: 0
type: integer
enable:
description: Enable indicates whether the resctrl qos
is enabled.
type: boolean
mbaPercent:
default: 100
description: MBA percent
format: int64
maximum: 100
minimum: 0
type: integer
type: object
type: object
lsr:
description: ResourceQoS for LSR pods.
Expand Down Expand Up @@ -451,6 +541,36 @@ spec:
format: int64
type: integer
type: object
resctrlQoS:
description: ResctrlQoSCfg stores node-level config of resctrl
qos
properties:
catRangeEndPercent:
default: 100
description: LLC available range end for pods by percentage
format: int64
maximum: 100
minimum: 0
type: integer
catRangeStartPercent:
default: 0
description: LLC available range start for pods by percentage
format: int64
maximum: 100
minimum: 0
type: integer
enable:
description: Enable indicates whether the resctrl qos
is enabled.
type: boolean
mbaPercent:
default: 100
description: MBA percent
format: int64
maximum: 100
minimum: 0
type: integer
type: object
type: object
system:
description: ResourceQoS for system pods
Expand Down Expand Up @@ -547,6 +667,36 @@ spec:
format: int64
type: integer
type: object
resctrlQoS:
description: ResctrlQoSCfg stores node-level config of resctrl
qos
properties:
catRangeEndPercent:
default: 100
description: LLC available range end for pods by percentage
format: int64
maximum: 100
minimum: 0
type: integer
catRangeStartPercent:
default: 0
description: LLC available range start for pods by percentage
format: int64
maximum: 100
minimum: 0
type: integer
enable:
description: Enable indicates whether the resctrl qos
is enabled.
type: boolean
mbaPercent:
default: 100
description: MBA percent
format: int64
maximum: 100
minimum: 0
type: integer
type: object
type: object
type: object
resourceUsedThresholdWithBE:
Expand Down
Loading

0 comments on commit dd30303

Please sign in to comment.