Skip to content

Commit d2f4f90

Browse files
authored
config-linux: add schemata field to IntelRdt (#1230)
* config-linux: add schemata field to IntelRdt Add a new "schemata" field to the Linux IntelRdt configuration. This addresses the complexity of separate schema fields and resolves the issue of supporting currently uncovered RDT features like L2 cache allocation and CDP (Code and Data Prioritization). The new field is for specifying the complete schemata (all schemas) to be written to the schemata file in Linux resctrl fs. The aim is for simple usage and runtime implementation (by not requiring any parsing/filtering of data or otherwise re-implement parsing or validation of the Linux resctrl interface) and also to support all RDT features now and in the future (i.e. schemas like L2, L2CODE, L2DATA, L3CODE and L3DATA and who knows L4 or something else in the future). Behavior of existing fields is not changed but it is required that the new schemata field is applied last. Signed-off-by: Markus Lehtonen <[email protected]> * Add linux.intelRdt.schemata to features.md Signed-off-by: Markus Lehtonen <[email protected]> --------- Signed-off-by: Markus Lehtonen <[email protected]>
1 parent 27cb002 commit d2f4f90

File tree

5 files changed

+39
-11
lines changed

5 files changed

+39
-11
lines changed

config-linux.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,7 @@ The following parameters can be specified for the container:
747747
The value SHOULD start with `L3:` and SHOULD NOT contain newlines.
748748
* **`memBwSchema`** *(string, OPTIONAL)* - specifies the schema of memory bandwidth per L3 cache id.
749749
The value MUST start with `MB:` and MUST NOT contain newlines.
750+
* **`schemata`** *(array of strings, OPTIONAL)* - specifies the schemata to be written to the `schemata` file in resctrlfs. Each element represents one line in the `schemata` file. The value MUST NOT contain newlines.
750751

751752
The following rules on parameters MUST be applied:
752753

@@ -756,15 +757,17 @@ The following rules on parameters MUST be applied:
756757

757758
* If either `l3CacheSchema` or `memBwSchema` is set, runtimes MUST write the value to the `schemata` file in the that sub-directory discussed in `closID`.
758759

759-
* If neither `l3CacheSchema` nor `memBwSchema` is set, runtimes MUST NOT write to `schemata` files in any `resctrl` pseudo-filesystems.
760+
* If `schemata` field is set, runtimes MUST write the value to the `schemata` file in the that sub-directory discussed in `closID`. If also `l3CacheSchema` or `memBwSchema` is set the value of `schemata` field must be written last, after the values from `l3CacheSchema` and `memBwSchema` has been written.
761+
762+
* If none of `l3CacheSchema`, `memBwSchema` or `schemata` is set, runtimes MUST NOT write to `schemata` files in any `resctrl` pseudo-filesystems.
760763

761764
* If `closID` is not set, runtimes MUST use the container ID from [`start`](runtime.md#start) and create the `<container-id>` directory.
762765

763-
* If `closID` is set, `l3CacheSchema` and/or `memBwSchema` is set
766+
* If `closID` is set, `l3CacheSchema` and/or `memBwSchema` and/or `schemata` is set
764767
* if `closID` directory in a mounted `resctrl` pseudo-filesystem doesn't exist, the runtimes MUST create it.
765768
* if `closID` directory in a mounted `resctrl` pseudo-filesystem exists, runtimes MUST compare `l3CacheSchema` and/or `memBwSchema` value with `schemata` file, and [generate an error](runtime.md#errors) if doesn't match.
766769

767-
* If `closID` is set, and neither of `l3CacheSchema` and `memBwSchema` are set, runtime MUST check if corresponding pre-configured directory `closID` is present in mounted `resctrl`. If such pre-configured directory `closID` exists, runtime MUST assign container to this `closID` and [generate an error](runtime.md#errors) if directory does not exist.
770+
* If `closID` is set, and none of `l3CacheSchema`, `memBwSchema` or `schemata` are set, runtime MUST check if corresponding pre-configured directory `closID` is present in mounted `resctrl`. If such pre-configured directory `closID` exists, runtime MUST assign container to this `closID` and [generate an error](runtime.md#errors) if directory does not exist.
768771

769772
* **`enableCMT`** *(boolean, OPTIONAL)* - specifies if Intel RDT CMT should be enabled:
770773
* CMT (Cache Monitoring Technology) supports monitoring of the last-level cache (LLC) occupancy
@@ -776,18 +779,27 @@ The following rules on parameters MUST be applied:
776779

777780
### Example
778781

779-
Consider a two-socket machine with two L3 caches where the default CBM is 0x7ff and the max CBM length is 11 bits,
780-
and minimum memory bandwidth of 10% with a memory bandwidth granularity of 10%.
782+
Consider a two-socket machine with:
783+
784+
- two L3 caches where the default CBM is 0x7ff (11 bits)
785+
- eight L2 caches where the default CBM is 0xFF (8 bits)
786+
- minimum memory bandwidth of 10% with a memory bandwidth granularity of 10%
787+
788+
Tasks inside the container:
781789

782-
Tasks inside the container only have access to the "upper" 7/11 of L3 cache on socket 0 and the "lower" 5/11 L3 cache on socket 1,
783-
and may use a maximum memory bandwidth of 20% on socket 0 and 70% on socket 1.
790+
- have access to the "upper" 7/11 of L3 cache on socket 0 and the "lower" 5/11 L3 cache on socket 1
791+
- have access to the "lower" 4/8 of L2 cache on socket 0 (socket 1 is left out from this example)
792+
- may use a maximum memory bandwidth of 20% on socket 0 and 70% on socket 1.
784793

785794
```json
786795
"linux": {
787796
"intelRdt": {
788797
"closID": "guaranteed_group",
789-
"l3CacheSchema": "L3:0=7f0;1=1f",
790-
"memBwSchema": "MB:0=20;1=70"
798+
"schemata": [
799+
"L3:0=7f0;1=1f",
800+
"L2:0=f;1=f;2=f;3=f",
801+
"MB:0=20;1=70"
802+
]
791803
}
792804
}
793805
```

features-linux.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,15 @@ Irrelevant to the availability of SELinux on the host operating system.
201201
Irrelevant to the availability of Intel RDT on the host operating system.
202202

203203
* **`enabled`** (bool, OPTIONAL) represents whether the runtime supports Intel RDT.
204+
* **`schemata`** (bool, OPTIONAL) represents whether the
205+
(`schemata` field of `linux.intelRdt` in `config.json`)[config-linux.md#intelrdt] is supported.
204206

205207
### Example
206208

207209
```json
208210
"intelRdt": {
209-
"enabled": true
211+
"enabled": true,
212+
"schemata": true
210213
}
211214
```
212215

features.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,8 @@ Here is a full example for reference.
355355
"enabled": true
356356
},
357357
"intelRdt": {
358-
"enabled": true
358+
"enabled": true,
359+
"schemata": true
359360
}
360361
},
361362
"annotations": {

schema/config-linux.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,9 @@
268268
"closID": {
269269
"type": "string"
270270
},
271+
"schemata": {
272+
"$ref": "defs.json#/definitions/ArrayOfStrings"
273+
},
271274
"l3CacheSchema": {
272275
"type": "string"
273276
},

specs-go/config.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,14 +836,23 @@ type LinuxSyscall struct {
836836
type LinuxIntelRdt struct {
837837
// The identity for RDT Class of Service
838838
ClosID string `json:"closID,omitempty"`
839+
840+
// Schemata specifies the complete schemata to be written as is to the
841+
// schemata file in resctrl fs. Each element represents a single line in the schemata file.
842+
// NOTE: This will overwrite schemas specified in the L3CacheSchema and/or
843+
// MemBwSchema fields.
844+
Schemata []string `json:"schemata,omitempty"`
845+
839846
// The schema for L3 cache id and capacity bitmask (CBM)
840847
// Format: "L3:<cache_id0>=<cbm0>;<cache_id1>=<cbm1>;..."
848+
// NOTE: Should not be specified if Schemata is non-empty.
841849
L3CacheSchema string `json:"l3CacheSchema,omitempty"`
842850

843851
// The schema of memory bandwidth per L3 cache id
844852
// Format: "MB:<cache_id0>=bandwidth0;<cache_id1>=bandwidth1;..."
845853
// The unit of memory bandwidth is specified in "percentages" by
846854
// default, and in "MBps" if MBA Software Controller is enabled.
855+
// NOTE: Should not be specified if Schemata is non-empty.
847856
MemBwSchema string `json:"memBwSchema,omitempty"`
848857

849858
// EnableCMT is the flag to indicate if the Intel RDT CMT is enabled. CMT (Cache Monitoring Technology) supports monitoring of

0 commit comments

Comments
 (0)