tuned/tuned-2.4.0-use_cpupower_for_intel_perf_bias.patch
Denisart Benjamin 185b14dacf Accepting request 354167 from home:pluskalm:branches:Base:System
- Update to 2.6.0
  * plugin_cpu: do not show error if cpupower or 
    x86_energy_perf_policy are missing
  * plugin_sysctl: fixed quoting of sysctl values
  * tuned-adm: added log file location hint to verify command output
  * libexec: fixed listdir and isdir in defirqaffinity.py
  * plugin_cpu: save and restore only intel pstate attributes that 
    were changed
  * functions: fixed sysfs save to work with options
  * plugins: added scsi_host plugin
  * tuned-adm: fixed restart attempt if tuned is not running
  * spec: fixed post scriptlet to work without grub
  * tuned-profiles-nfv: fix find-lapictscdeadline-optimal.sh for 
    CPUS where ns > 6500
  * functions: fixed restore_logs_syncing to preserve SELinux 
    context on rsyslog.conf
  * realtime: set unboud workqueues cpumask
  * spec: correctly remove tuned footprint from /etc/default/grub
  * gui: fixed creation of new profile
  * profiles: removed nohz_full from the realtime profile
  * profiles: Added nohz_full and nohz=on to realtime guest/host 
    profiles
  * profiles: fixed lapic_timer_adv_ns cache
  * plugin_sysctl: pass verification even if the option doesn't 
    exist
  * added support for 'summary' and 'description' of profiles, 
    extended D-Bus API for better Cockpit support

OBS-URL: https://build.opensuse.org/request/show/354167
OBS-URL: https://build.opensuse.org/package/show/Base:System/tuned?expand=0&rev=41
2016-01-17 09:49:46 +00:00

63 lines
2.2 KiB
Diff

Index: tuned-2.6.0/tuned/plugins/plugin_cpu.py
===================================================================
--- tuned-2.6.0.orig/tuned/plugins/plugin_cpu.py
+++ tuned-2.6.0/tuned/plugins/plugin_cpu.py
@@ -109,7 +109,8 @@ class CPULatencyPlugin(base.Plugin):
# Check for cpupower, use workaround if not available
self._check_cpupower()
# Check for x86_energy_perf_policy, ignore if not available / supported
- self._check_energy_perf_bias()
+ if self._has_cpupower is False:
+ self._check_energy_perf_bias()
# Check for intel_pstate
self._check_intel_pstate()
else:
@@ -237,7 +238,17 @@ class CPULatencyPlugin(base.Plugin):
if not self._is_cpu_online(device):
log.debug("%s is not online, skipping" % device)
return None
- if self._has_energy_perf_bias:
+ if self._has_cpupower is True:
+ bias_str = str(energy_perf_bias)
+ if bias_str == "performance":
+ bias_str = "0"
+ elif bias_str == "powersave":
+ bias_str = "15"
+ elif bias_str == "normal":
+ bias_str = "6"
+ cpu_id = device.lstrip("cpu")
+ self._cmd.execute(["cpupower", "-c", cpu_id, "set", "-b", bias_str])
+ elif self._has_energy_perf_bias:
if not sim:
cpu_id = device.lstrip("cpu")
log.info("setting energy_perf_bias '%s' on cpu '%s'" % (energy_perf_bias, device))
@@ -265,14 +276,21 @@ class CPULatencyPlugin(base.Plugin):
if not self._is_cpu_online(device):
log.debug("%s is not online, skipping" % device)
return None
- if self._has_energy_perf_bias:
+ if self._has_cpupower is True:
+ cpu_id = device.lstrip("cpu")
+ retcode, lines = self._cmd.execute(["cpupower", "-c", cpu_id, "info", "-b"])
+ elif self._has_energy_perf_bias:
cpu_id = device.lstrip("cpu")
retcode, lines = self._cmd.execute(["x86_energy_perf_policy", "-c", cpu_id, "-r"])
- if retcode == 0:
- for line in lines.splitlines():
- l = line.split()
- if len(l) == 2:
- energy_perf_bias = self._energy_perf_policy_to_human(l[1])
- break
+ else:
+ return None
+ if retcode == 0:
+ for line in lines.splitlines():
+ if line.startswith("analyzing CPU"):
+ continue
+ l = line.split()
+ if len(l) == 2:
+ energy_perf_bias = l[1]
+ break
return energy_perf_bias