Take another VM stop reason to account, add aditional setting for cpu QOS and add a job to sync VM pids to resctrl. Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
44 lines
1.7 KiB
Diff
44 lines
1.7 KiB
Diff
From 14b8a140c5794b28ccbb1c396924a9363767b7ea Mon Sep 17 00:00:00 2001
|
|
From: Keqian Zhu <zhukeqian1@huawei.com>
|
|
Date: Thu, 4 Aug 2022 15:34:59 -0400
|
|
Subject: [PATCH 2/3] cpu_qos: Add aditional setting for cpu QOS
|
|
|
|
Set overload_detect_period and offline_wait_interval, so as
|
|
to prevent low priority vm to be hungry too much time.
|
|
|
|
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
|
|
---
|
|
qos_controller/cpucontroller.py | 8 +++++++-
|
|
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/qos_controller/cpucontroller.py b/qos_controller/cpucontroller.py
|
|
index f857973..f2a67e0 100644
|
|
--- a/qos_controller/cpucontroller.py
|
|
+++ b/qos_controller/cpucontroller.py
|
|
@@ -23,6 +23,10 @@ import util
|
|
|
|
LOW_PRIORITY_SLICES_PATH = "/sys/fs/cgroup/cpu/low_prio_machine.slice"
|
|
LOW_PRIORITY_QOS_LEVEL = -1
|
|
+OVERLOAG_DETECT_PERIOD_PATH = "/proc/sys/kernel/qos_overload_detect_period_ms"
|
|
+OVERLOAG_DETECT_PERIOD_MS = 100
|
|
+OFFLINE_WAIT_INTERVAL_PATH = "/proc/sys/kernel/qos_offline_wait_interval_ms"
|
|
+OFFLINE_WAIT_INTERVAL_MS = 100
|
|
MIN_QUOTA_US = 0
|
|
|
|
|
|
@@ -36,8 +40,10 @@ class CpuController:
|
|
qos_level_path = os.path.join(LOW_PRIORITY_SLICES_PATH, "cpu.qos_level")
|
|
try:
|
|
util.file_write(qos_level_path, str(LOW_PRIORITY_QOS_LEVEL))
|
|
+ util.file_write(OVERLOAG_DETECT_PERIOD_PATH, str(OVERLOAG_DETECT_PERIOD_MS))
|
|
+ util.file_write(OFFLINE_WAIT_INTERVAL_PATH, str(OFFLINE_WAIT_INTERVAL_MS))
|
|
except IOError as error:
|
|
- LOGGER.error("Failed to set low priority cpu qos level: %s" % str(error))
|
|
+ LOGGER.error("Failed to configure CPU QoS for low priority VMs: %s" % str(error))
|
|
raise
|
|
|
|
def limit_domain_bandwidth(self, guest_info, quota_threshold, abnormal_threshold):
|
|
--
|
|
2.33.0
|
|
|