Skip to content

Commit 8062b07

Browse files
committed
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]>
1 parent c0e9043 commit 8062b07

File tree

3 files changed

+30
-10
lines changed

3 files changed

+30
-10
lines changed

config-linux.md

+18-10
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,7 @@ The following parameters can be specified for the container:
645645
The value SHOULD start with `L3:` and SHOULD NOT contain newlines.
646646
* **`memBwSchema`** *(string, OPTIONAL)* - specifies the schema of memory bandwidth per L3 cache id.
647647
The value MUST start with `MB:` and MUST NOT contain newlines.
648+
* **`schemata`** *(string, OPTIONAL)* - specifies the schemata to be written to the `schemata` file in resctrlfs.
648649

649650
The following rules on parameters MUST be applied:
650651

@@ -654,15 +655,17 @@ The following rules on parameters MUST be applied:
654655

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

657-
* If neither `l3CacheSchema` nor `memBwSchema` is set, runtimes MUST NOT write to `schemata` files in any `resctrl` pseudo-filesystems.
658+
* 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.
659+
660+
* If none of `l3CacheSchema`, `memBwSchema` or `schemata` is set, runtimes MUST NOT write to `schemata` files in any `resctrl` pseudo-filesystems.
658661

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

661-
* If `closID` is set, `l3CacheSchema` and/or `memBwSchema` is set
664+
* If `closID` is set, `l3CacheSchema` and/or `memBwSchema` and/or `schemata` is set
662665
* if `closID` directory in a mounted `resctrl` pseudo-filesystem doesn't exist, the runtimes MUST create it.
663-
* 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.
666+
* if `closID` directory in a mounted `resctrl` pseudo-filesystem exists, runtimes MUST compare `l3CacheSchema` and/or `memBwSchema` and/or `schemata` value with `schemata` file, and [generate an error](runtime.md#errors) if doesn't match.
664667

665-
* 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.
668+
* 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.
666669

667670
* **`enableCMT`** *(boolean, OPTIONAL)* - specifies if Intel RDT CMT should be enabled:
668671
* CMT (Cache Monitoring Technology) supports monitoring of the last-level cache (LLC) occupancy
@@ -674,18 +677,23 @@ The following rules on parameters MUST be applied:
674677

675678
### Example
676679

677-
Consider a two-socket machine with two L3 caches where the default CBM is 0x7ff and the max CBM length is 11 bits,
678-
and minimum memory bandwidth of 10% with a memory bandwidth granularity of 10%.
680+
Consider a two-socket machine with:
681+
682+
- two L3 caches where the default CBM is 0x7ff (11 bits)
683+
- eight L2 caches where the default CBM is 0xFF (8 bits)
684+
- minimum memory bandwidth of 10% with a memory bandwidth granularity of 10%
685+
686+
Tasks inside the container:
679687

680-
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,
681-
and may use a maximum memory bandwidth of 20% on socket 0 and 70% on socket 1.
688+
- have access to the "upper" 7/11 of L3 cache on socket 0 and the "lower" 5/11 L3 cache on socket 1
689+
- have access to the "lower" 4/8 of L2 cache on socket 0 (socket 1 is left out from this example)
690+
- may use a maximum memory bandwidth of 20% on socket 0 and 70% on socket 1.
682691

683692
```json
684693
"linux": {
685694
"intelRdt": {
686695
"closID": "guaranteed_group",
687-
"l3CacheSchema": "L3:0=7f0;1=1f",
688-
"memBwSchema": "MB:0=20;1=70"
696+
"schemata": "L3:0=7f0;1=1f\nL2:0=f;1=f;2=f;3=f\nMB:0=20;1=70"
689697
}
690698
}
691699
```

schema/config-linux.json

+3
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@
262262
"closID": {
263263
"type": "string"
264264
},
265+
"schemata": {
266+
"type": "string"
267+
},
265268
"l3CacheSchema": {
266269
"type": "string"
267270
},

specs-go/config.go

+9
Original file line numberDiff line numberDiff line change
@@ -795,14 +795,23 @@ type LinuxSyscall struct {
795795
type LinuxIntelRdt struct {
796796
// The identity for RDT Class of Service
797797
ClosID string `json:"closID,omitempty"`
798+
799+
// Schemata specifies the complete schemata to be written as is to the
800+
// schemata file in resctrl fs.
801+
// NOTE: This will overwrite schemas specified in the L3CacheSchema and/or
802+
// MemBwSchema fields.
803+
Schemata string `json:"schemata,omitempty"`
804+
798805
// The schema for L3 cache id and capacity bitmask (CBM)
799806
// Format: "L3:<cache_id0>=<cbm0>;<cache_id1>=<cbm1>;..."
807+
// NOTE: Should not be specified if Schemata is non-empty.
800808
L3CacheSchema string `json:"l3CacheSchema,omitempty"`
801809

802810
// The schema of memory bandwidth per L3 cache id
803811
// Format: "MB:<cache_id0>=bandwidth0;<cache_id1>=bandwidth1;..."
804812
// The unit of memory bandwidth is specified in "percentages" by
805813
// default, and in "MBps" if MBA Software Controller is enabled.
814+
// NOTE: Should not be specified if Schemata is non-empty.
806815
MemBwSchema string `json:"memBwSchema,omitempty"`
807816

808817
// 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)