From b8343bc774f6216c7b0e1bcfb16f8f7b15bcc031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Szulik?= Date: Fri, 6 Nov 2020 15:24:23 +0100 Subject: [PATCH] config-linux: Add Intel RDT CMT and MBM Linux support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for Intel Resource Director Technology (RDT) / Cache Monitoring Technology (CMT) and Memory Bandwidth Monitoring (MBM). Example: "linux": { "intelRdt": { "monitoring": true } } This is the prerequisite of this runc proposal: https://github.com/opencontainers/runc/issues/2519 For more information about Intel RDT CMT and MBM, please refer to: https://github.com/opencontainers/runc/issues/2519 Signed-off-by: Paweł Szulik --- config-linux.md | 1 + schema/config-linux.json | 3 +++ specs-go/config.go | 10 +++++++--- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/config-linux.md b/config-linux.md index 99de39c2f..1295d0052 100644 --- a/config-linux.md +++ b/config-linux.md @@ -549,6 +549,7 @@ The following parameters can be specified for the container: * 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. +* **`monitoring`** *(boolean OPTIONAL)* - specifies if Intel RDT monitoring features (CMT and MBM) should be enabled ### Example diff --git a/schema/config-linux.json b/schema/config-linux.json index 83478cc9f..699bee160 100644 --- a/schema/config-linux.json +++ b/schema/config-linux.json @@ -250,6 +250,9 @@ "memBwSchema": { "type": "string", "pattern": "^MB:[^\\n]*$" + }, + "monitoring": { + "type": "boolean" } } }, diff --git a/specs-go/config.go b/specs-go/config.go index 5fceeb635..6508ff837 100644 --- a/specs-go/config.go +++ b/specs-go/config.go @@ -178,7 +178,7 @@ type Linux struct { // MountLabel specifies the selinux context for the mounts in the container. MountLabel string `json:"mountLabel,omitempty"` // IntelRdt contains Intel Resource Director Technology (RDT) information for - // handling resource constraints (e.g., L3 cache, memory bandwidth) for the container + // handling resource constraints and monitoring metrics (e.g., L3 cache, memory bandwidth) for the container IntelRdt *LinuxIntelRdt `json:"intelRdt,omitempty"` // Personality contains configuration for the Linux personality syscall Personality *LinuxPersonality `json:"personality,omitempty"` @@ -678,8 +678,9 @@ type LinuxSyscall struct { Args []LinuxSeccompArg `json:"args,omitempty"` } -// LinuxIntelRdt has container runtime resource constraints for Intel RDT -// CAT and MBA features which introduced in Linux 4.10 and 4.12 kernel +// LinuxIntelRdt has container runtime resource constraints for Intel RDT CAT and MBA +// features and a flag of monitoring metric for Intel RDT CMT and MBM features. +// Intel RDT features are available in Linux 4.14 and newer kernel versions type LinuxIntelRdt struct { // The identity for RDT Class of Service ClosID string `json:"closID,omitempty"` @@ -692,4 +693,7 @@ type LinuxIntelRdt struct { // The unit of memory bandwidth is specified in "percentages" by // default, and in "MBps" if MBA Software Controller is enabled. MemBwSchema string `json:"memBwSchema,omitempty"` + + // The flag to indicate if Intel RDT monitoring features (CMT and MBM) are enabled. + Monitoring bool `json:"monitoring,omitempty"` }