Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.1:Update
tuned
tuned_differ_x86_and_other_archs_in_cpu_plugin_...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File tuned_differ_x86_and_other_archs_in_cpu_plugin_mainline.patch of Package tuned
From: Thomas Renninger <trenn@suse.com> Subject: Differ archs and x86 CPU vendors in plugin_cpu References: fate#326694 Patch-Mainline: v2.11.0-rc.1 Git-commit: 29022a0edf651347f432463f359b0f3c42ee5348 Git-repo: https://github.com/openSUSE/tuned.git This avoids wrong warning about a missing intel tool (x86_energy_perf_bias) Remember arch and x86 CPU vendor to allow arch/vendor specific CPU tunings in the future Signed-off-by: Thomas Renninger <trenn@suse.com> diff --git a/tuned/plugins/plugin_cpu.py b/tuned/plugins/plugin_cpu.py index 8f0babd..241e157 100644 --- a/tuned/plugins/plugin_cpu.py +++ b/tuned/plugins/plugin_cpu.py @@ -7,6 +7,8 @@ import tuned.consts as consts import os import struct import errno +import platform +import procfs log = tuned.logs.get() @@ -22,7 +24,11 @@ class CPULatencyPlugin(base.Plugin): super(CPULatencyPlugin, self).__init__(*args, **kwargs) self._has_pm_qos = True - self._has_energy_perf_bias = True + self._arch = "x86_64" + self._is_x86 = False + self._is_intel = False + self._is_amd = False + self._has_energy_perf_bias = False self._has_intel_pstate = False self._min_perf_pct_save = None @@ -58,6 +64,33 @@ class CPULatencyPlugin(base.Plugin): "no_turbo" : None, } + def _check_arch(self): + intel_archs = [ "x86_64", "i686", "i585", "i486", "i386" ] + self._arch = platform.machine() + + if self._arch in intel_archs: + # Possible other x86 vendors (from arch/x86/kernel/cpu/*): + # "CentaurHauls", "CyrixInstead", "Geode by NSC", "HygonGenuine", "GenuineTMx86", + # "TransmetaCPU", "UMC UMC UMC" + cpu = procfs.cpuinfo() + vendor = cpu.tags.get("vendor_id") + if vendor is "GenuineIntel": + self._is_intel = True + elif vendor is "AuthenticAMD" or vendor is "HygonGenuine": + self._is_amd = True + else: + # We always assign Intel, unless we know better + self._is_intel = True + log.info("We are running on an x86 %s platform" % vendor) + else: + log.info("We are running on %s (non x86)" % self._arch) + + if self._is_intel is True: + # Check for x86_energy_perf_policy, ignore if not available / supported + self._check_energy_perf_bias() + # Check for intel_pstate + self._check_intel_pstate() + def _check_energy_perf_bias(self): self._has_energy_perf_bias = False retcode_unsupported = 1 @@ -110,10 +143,7 @@ class CPULatencyPlugin(base.Plugin): else: instance._load_monitor = None - # Check for x86_energy_perf_policy, ignore if not available / supported - self._check_energy_perf_bias() - # Check for intel_pstate - self._check_intel_pstate() + self._check_arch() else: instance._first_instance = False log.info("Latency settings from non-first CPU plugin instance '%s' will be ignored." % instance.name)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor