Accepting request 668631 from Base:System

- Differ archs and x86 CPU vendors to avoid 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 (fate#326694)
A tuned_differ_x86_and_other_archs_in_cpu_plugin.patch
- Require virt-what to be able to detect whether it is running
  on a virtual machine

- Update to latest git head commit 26db89de18efad1b4536
  including quite some mainline fixes
- tuned needs polkit daemon running

OBS-URL: https://build.opensuse.org/request/show/668631
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/tuned?expand=0&rev=19
This commit is contained in:
Dominique Leuenberger 2019-01-26 21:22:21 +00:00 committed by Git OBS Bridge
commit 53325bbf9a
5 changed files with 96 additions and 3 deletions

View File

@ -6,7 +6,6 @@
<param name="versionformat">2.9.0+git%cd.%h</param>
-->
<param name="versionformat">2.10.0</param>
<param name="changesgenerate">enable</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">tuned*.tar</param>

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0f409c066754d23ae27d40fa34b36f2f5de66b4188f79b09cd5a9ebc0a99f386
size 132068
oid sha256:845edda9d83d25643efa266f7edf11719a17b32e3955b79c89755ad20674cdce
size 133120

View File

@ -1,3 +1,21 @@
-------------------------------------------------------------------
Wed Jan 16 10:47:12 UTC 2019 - trenn@suse.de
- Differ archs and x86 CPU vendors to avoid 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 (fate#326694)
A tuned_differ_x86_and_other_archs_in_cpu_plugin.patch
- Require virt-what to be able to detect whether it is running
on a virtual machine
-------------------------------------------------------------------
Fri Jan 11 18:26:17 UTC 2019 - trenn@suse.de
- Update to latest git head commit 26db89de18efad1b4536
including quite some mainline fixes
- tuned needs polkit daemon running
-------------------------------------------------------------------
Thu Jan 3 15:43:38 UTC 2019 - trenn@suse.de

View File

@ -30,6 +30,7 @@ Source1: tuned.rpmlintrc
# PATCH-FIX-OPENSUSE fix-allow-receive_sender-default.patch <allow receive_sender="com.redhat.com"/> allow receive_* is normally
# not needed as that is the default --<p.drouand@gmail.com>
Patch0: fix-allow-receive_sender-default.patch
Patch1: tuned_differ_x86_and_other_archs_in_cpu_plugin.patch
BuildRequires: bash-completion
BuildRequires: desktop-file-utils
BuildRequires: pkgconfig
@ -40,6 +41,7 @@ Requires: cpupower >= 4.19
Requires: ethtool
Requires: gawk
Requires: hdparm
Requires: polkit
Requires: python3-configobj
Requires: python3-dbus-python
Requires: python3-decorator
@ -47,6 +49,7 @@ Requires: python3-gobject
Requires: python3-linux-procfs
Requires: python3-pyudev
Requires: util-linux
Requires: virt-what
Obsoletes: pm-profiler
BuildArch: noarch
%{?systemd_requires}
@ -237,6 +240,7 @@ sed -i 's|.*/\([^/]\+\)/[^\.]\+\.conf|\1|' %{_sysconfdir}/tuned/active_profile
%{_mandir}/man8/tuned*
%dir %{_datadir}/tuned
%ghost %dir /run/tuned
%{_prefix}/lib/kernel/install.d/92-tuned.install
%files gtk
%dir %{_datadir}/icons/hicolor

View File

@ -0,0 +1,72 @@
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)