From 06cf8993d85e305578e0499198ea201db60fe56f Mon Sep 17 00:00:00 2001 From: Lin Yang Date: Mon, 27 Aug 2018 17:10:35 -0700 Subject: [PATCH] config-linux: add Intel RDT CLOS name sharing support Creating a dedicated RDT Class of Service (CLOS) for each running container, even they have exactly same Scheam, will lead to short of CLOS, since there is a hardware limit for the number of CLOS, around 16 CLOS per platform. This PR add one parameter 'closID' into existed spec to allow user to specify which RDT Class of Service (CLOS) the container will be located. So it can place these containers with same Schema into one single CLOS. Example: "linux": { "intelRdt": { "closID": "guaranteed_group", "l3CacheSchema": "L3:0=ffff0;1=3ff" } } Signed-off-by: Lin Yang --- config-linux.md | 10 +++++++--- schema/config-linux.json | 3 +++ specs-go/config.go | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/config-linux.md b/config-linux.md index e3d4100ab..f84124e88 100644 --- a/config-linux.md +++ b/config-linux.md @@ -488,17 +488,20 @@ You MUST specify at least one of the `hcaHandles` or `hcaObjects` in a given ent ## IntelRdt **`intelRdt`** (object, OPTIONAL) represents the [Intel Resource Director Technology][intel-rdt-cat-kernel-interface]. - If `intelRdt` is set, the runtime MUST write the container process ID to the `/tasks` file in a mounted `resctrl` pseudo-filesystem, using the container ID from [`start`](runtime.md#start) and creating the `` directory if necessary. + If `intelRdt` is set, the runtime MUST write the container process ID to the `tasks` file in a proper sub-directory in a mounted `resctrl` pseudo-filesystem. That sub-directory name is specified by `closID` parameter. If no mounted `resctrl` pseudo-filesystem is available in the [runtime mount namespace](glossary.md#runtime-namespace), the runtime MUST [generate an error](runtime.md#errors). If `intelRdt` is not set, the runtime MUST NOT manipulate any `resctrl` pseudo-filesystems. The following parameters can be specified for the container: +* **`closID`** *(string, OPTIONAL)* - specifies the identity for RDT Class of Service (CLOS). + If `closID` is set, runtimes MUST create `closID` directory in a mounted `resctrl` pseudo-filesystem if it doesn't exist. If not set, runtimes MUST use the container ID from [`start`](runtime.md#start) and create the `` directory. + * **`l3CacheSchema`** *(string, OPTIONAL)* - specifies the schema for L3 cache id and capacity bitmask (CBM). - If `l3CacheSchema` is set, runtimes MUST write the value to the `schemata` file in the `` directory discussed in `intelRdt`. + If `l3CacheSchema` is set, runtimes MUST write the value to the `schemata` file in that sub-directory discussed in `closID`. If not set, runtimes MUST NOT write to `schemata` files in any `resctrl` pseudo-filesystems. - If `l3CacheSchema` is not set, runtimes MUST NOT write to `schemata` files in any `resctrl` pseudo-filesystems. + If `closID` and `l3CacheSchema` both are set, runtimes MUST compare `l3CacheSchema` value with `schemata` file, and [generate an error](runtime.md#errors) if doesn't match. ### Example @@ -508,6 +511,7 @@ Tasks inside the container only have access to the "upper" 80% of L3 cache id 0 ```json "linux": { "intelRdt": { + "closID": "guaranteed_group", "l3CacheSchema": "L3:0=ffff0;1=3ff" } } diff --git a/schema/config-linux.json b/schema/config-linux.json index 5a3fd50e1..54f1ff44d 100644 --- a/schema/config-linux.json +++ b/schema/config-linux.json @@ -228,6 +228,9 @@ "intelRdt": { "type": "object", "properties": { + "closID": { + "type": "string" + }, "l3CacheSchema": { "type": "string" } diff --git a/specs-go/config.go b/specs-go/config.go index 7781c5361..06bad0578 100644 --- a/specs-go/config.go +++ b/specs-go/config.go @@ -624,6 +624,8 @@ type LinuxSyscall struct { // LinuxIntelRdt has container runtime resource constraints // for Intel RDT/CAT which introduced in Linux 4.10 kernel type LinuxIntelRdt struct { + // The identity for RDT Class of Service + ClosID string `json:"closID,omitempty"` // The schema for L3 cache id and capacity bitmask (CBM) // Format: "L3:=;=;..." L3CacheSchema string `json:"l3CacheSchema,omitempty"`