diff --git a/docs/proposals/koordlet/20231227-koordlet-resctrl-qos-enhance.md b/docs/proposals/koordlet/20231227-koordlet-resctrl-qos-enhance.md index 5e12b28b2..7c5d85b15 100644 --- a/docs/proposals/koordlet/20231227-koordlet-resctrl-qos-enhance.md +++ b/docs/proposals/koordlet/20231227-koordlet-resctrl-qos-enhance.md @@ -132,20 +132,67 @@ considerations for performance, reliability and security. ##### NFR2 ### API -To support pod level LLC/MBA limit, we add a new annotation, the annotation key is `node.koordinator.sh/resctrl`, the annotation value finally will be parsed as below: +To support pod level LLC/MBA limit, we add a new annotation, the annotation key is `node.koordinator.sh/resctrl`. + +Below is the example value of the annotation. schemata defines all caches' configuration. schemataPerCache will define specific cache's configuration which will not use all caches' configuration. ```go -type Resctrl struct { - L3 map[int64]int64 - MB map[int64]int64 +{ + "LLC": { + "schemata": { + "range": [20,80], + }, + "schemataPerCache": { + { + "cacheid" : 0, + "schemata": { + "range": [20,50], + } + }, + { + "cacheid" : 1, + "schemata": { + "range": [20,60], + } + }, + }, + }, + "MB": { + "schemata": { + "percent": 20, + }, + "schemataPerCache": { + { + "cacheid": 0, + "percent": 20 + }, + { + "cacheid": 1, + "percent": 40 + }, + }, + } } ``` -Below is the example of annotation. 80 means 80% of LLC. 60 means 60% of MB. +schemata and schemataPerCache are defined as below structures: + +```go +type SchemataConfig struct { + Percent int `json:"percent,omitempty"` + Range []int `json:"percent,omitempty"` +} + +type SchematePerCacheConfig struct { + CacheID int "json:"cacheID,omitempty"" + SchemataConfig `json:",inline"` +} +``` +The annotation value finally will be parsed as below which define LLC and MB configuration: ```go -{ - "L3": "80" - "MB": "60" +type Resctrl struct { + LLC map[int]int64 + MB map[int]int64 } ```