From 3c555696602d865bc1a01e3f08580e6725cf10bb Mon Sep 17 00:00:00 2001 From: Sabbir Hasan Date: Wed, 13 Mar 2024 17:30:21 +0100 Subject: [PATCH 1/2] test message Signed-off-by: Sabbir Hasan --- .../tuned/openshift-node-performance | 2 +- .../profiles/functions/function_set_pstate.py | 37 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 assets/tuned/daemon/tuned/profiles/functions/function_set_pstate.py diff --git a/assets/performanceprofile/tuned/openshift-node-performance b/assets/performanceprofile/tuned/openshift-node-performance index 7569013f06..a5dbb99409 100644 --- a/assets/performanceprofile/tuned/openshift-node-performance +++ b/assets/performanceprofile/tuned/openshift-node-performance @@ -165,7 +165,7 @@ cmdline_pstate=+intel_pstate=passive {{else if .HardwareTuning}} cmdline_pstate=+intel_pstate=active {{else if .RealTimeHint}} -cmdline_pstate=+intel_pstate=disable +cmdline_pstate=+intel_pstate=${f:set_pstate} {{end}} [rtentsk] diff --git a/assets/tuned/daemon/tuned/profiles/functions/function_set_pstate.py b/assets/tuned/daemon/tuned/profiles/functions/function_set_pstate.py new file mode 100644 index 0000000000..c778503007 --- /dev/null +++ b/assets/tuned/daemon/tuned/profiles/functions/function_set_pstate.py @@ -0,0 +1,37 @@ +import os +import tuned.logs +from . import base +from tuned.utils.commands import commands + +log = tuned.logs.get() + +processor_name = ("sandybridge", + "ivybridge", + "haswell", + "broadwell", + "skylake", + "kabylake", + "cometlake", + "canonlake") + +pmu_path = "/sys/devices/cpu/caps/pmu_name" +class intel_recommended_pstate(base.Function): + """ + Checks the processor name and set the pstate + """ + def __init__(self): + # arbitrary number of arguments + super(intel_recommended_pstate, self).__init__("set_pstate_processor", 0) + + def execute(self, args): + pstate="disable" + if not super(intel_recommended_pstate, self).execute(args): + return None + + current_processor_name = self._cmd.read_file(pmu_path) + if current_processor_name == "" or current_processor_name in processor_name: + return pstate + pstate = "active" + return pstate + + From d60636399be291e72d41fb6b5948811b7cc8372d Mon Sep 17 00:00:00 2001 From: Sabbir Hasan Date: Mon, 18 Mar 2024 15:45:34 +0100 Subject: [PATCH 2/2] Update openshift-node-performance --- assets/performanceprofile/tuned/openshift-node-performance | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/performanceprofile/tuned/openshift-node-performance b/assets/performanceprofile/tuned/openshift-node-performance index a5dbb99409..18becd08fc 100644 --- a/assets/performanceprofile/tuned/openshift-node-performance +++ b/assets/performanceprofile/tuned/openshift-node-performance @@ -165,7 +165,7 @@ cmdline_pstate=+intel_pstate=passive {{else if .HardwareTuning}} cmdline_pstate=+intel_pstate=active {{else if .RealTimeHint}} -cmdline_pstate=+intel_pstate=${f:set_pstate} +cmdline_pstate=+intel_pstate=${f:intel_recommended_pstate} {{end}} [rtentsk]