commit tuned for openSUSE:Factory
![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
Hello community,
here is the log from the commit of package tuned for openSUSE:Factory checked in at 2016-01-21 23:42:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/tuned (Old)
and /work/SRC/openSUSE:Factory/.tuned.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "tuned"
Changes:
--------
--- /work/SRC/openSUSE:Factory/tuned/tuned.changes 2015-10-06 13:24:53.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.tuned.new/tuned.changes 2016-01-22 01:07:22.000000000 +0100
@@ -1,0 +2,31 @@
+Sun Jan 17 09:21:58 UTC 2016 - mpluskal@suse.com
+
+- 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
+
+-------------------------------------------------------------------
Old:
----
tuned-2.5.1.tar.bz2
New:
----
tuned-2.6.0.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ tuned.spec ++++++
--- /var/tmp/diff_new_pack.B9uuxI/_old 2016-01-22 01:07:24.000000000 +0100
+++ /var/tmp/diff_new_pack.B9uuxI/_new 2016-01-22 01:07:24.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package tuned
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{!?_tmpfilesdir:%global _tmpfilesdir %{_libexecdir}/tmpfiles.d}
Name: tuned
-Version: 2.5.1
+Version: 2.6.0
Release: 0
Summary: A dynamic adaptive system tuning daemon
License: GPL-2.0+
++++++ fix-allow-receive_sender-default.patch ++++++
--- /var/tmp/diff_new_pack.B9uuxI/_old 2016-01-22 01:07:24.000000000 +0100
+++ /var/tmp/diff_new_pack.B9uuxI/_new 2016-01-22 01:07:24.000000000 +0100
@@ -1,7 +1,7 @@
-Index: tuned-2.5.1/dbus.conf
+Index: tuned-2.6.0/dbus.conf
===================================================================
---- tuned-2.5.1.orig/dbus.conf
-+++ tuned-2.5.1/dbus.conf
+--- tuned-2.6.0.orig/dbus.conf
++++ tuned-2.6.0/dbus.conf
@@ -9,7 +9,6 @@
<busconfig>
<policy context="default">
++++++ tuned-2.4.0-use_cpupower_for_intel_perf_bias.patch ++++++
--- /var/tmp/diff_new_pack.B9uuxI/_old 2016-01-22 01:07:24.000000000 +0100
+++ /var/tmp/diff_new_pack.B9uuxI/_new 2016-01-22 01:07:24.000000000 +0100
@@ -1,8 +1,8 @@
-Index: tuned-2.5.1/tuned/plugins/plugin_cpu.py
+Index: tuned-2.6.0/tuned/plugins/plugin_cpu.py
===================================================================
---- tuned-2.5.1.orig/tuned/plugins/plugin_cpu.py
-+++ tuned-2.5.1/tuned/plugins/plugin_cpu.py
-@@ -108,7 +108,8 @@ class CPULatencyPlugin(base.Plugin):
+--- 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
@@ -12,7 +12,7 @@
# Check for intel_pstate
self._check_intel_pstate()
else:
-@@ -234,7 +235,17 @@ class CPULatencyPlugin(base.Plugin):
+@@ -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
@@ -31,7 +31,7 @@
if not sim:
cpu_id = device.lstrip("cpu")
log.info("setting energy_perf_bias '%s' on cpu '%s'" % (energy_perf_bias, device))
-@@ -262,14 +273,21 @@ class CPULatencyPlugin(base.Plugin):
+@@ -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
++++++ tuned-2.5.1.tar.bz2 -> tuned-2.6.0.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/libexec/defirqaffinity.py new/tuned-2.6.0/libexec/defirqaffinity.py
--- old/tuned-2.5.1/libexec/defirqaffinity.py 2015-07-01 16:21:17.000000000 +0200
+++ new/tuned-2.6.0/libexec/defirqaffinity.py 2015-08-21 12:09:16.000000000 +0200
@@ -1,3 +1,5 @@
+#!/usr/bin/python
+
# Helper script for realtime profiles provided by RT
import os
@@ -57,7 +59,7 @@
sys.exit(1)
# now verify each /proc/irq/$num/smp_affinity
- interruptdirs = [ f for f in listdir(irqpath) if isdir(join(irqpath,f)) ]
+ interruptdirs = [ f for f in os.listdir(irqpath) if os.path.isdir(join(irqpath,f)) ]
# IRQ 2 - cascaded signals from IRQs 8-15 (any devices configured to use IRQ 2 will actually be using IRQ 9)
interruptdirs.remove("2")
# IRQ 0 - system timer (cannot be changed)
@@ -103,7 +105,7 @@
# now adjust each /proc/irq/$num/smp_affinity
-interruptdirs = [ f for f in listdir(irqpath) if isdir(join(irqpath,f)) ]
+interruptdirs = [ f for f in os.listdir(irqpath) if os.path.isdir(join(irqpath,f)) ]
# IRQ 2 - cascaded signals from IRQs 8-15 (any devices configured to use IRQ 2 will actually be using IRQ 9)
interruptdirs.remove("2")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/atomic-guest/tuned.conf new/tuned-2.6.0/profiles/atomic-guest/tuned.conf
--- old/tuned-2.5.1/profiles/atomic-guest/tuned.conf 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/profiles/atomic-guest/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -3,6 +3,7 @@
#
[main]
+summary=Optimize virtual guests based on the Atomic variant
include=virtual-guest
[selinux]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/atomic-host/tuned.conf new/tuned-2.6.0/profiles/atomic-host/tuned.conf
--- old/tuned-2.5.1/profiles/atomic-host/tuned.conf 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/profiles/atomic-host/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -3,6 +3,7 @@
#
[main]
+summary=Optimize bare metal systems running the Atomic variant
include=throughput-performance
[selinux]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/balanced/tuned.conf new/tuned-2.6.0/profiles/balanced/tuned.conf
--- old/tuned-2.5.1/profiles/balanced/tuned.conf 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/profiles/balanced/tuned.conf 2016-01-05 10:33:56.000000000 +0100
@@ -2,6 +2,9 @@
# tuned configuration
#
+[main]
+summary=General non-specialized tuned profile
+
[cpu]
governor=conservative
energy_perf_bias=normal
@@ -15,4 +18,6 @@
[disk]
# Comma separated list of devices, all devices if commented out.
# devices=sda
+
+[scsi_host]
alpm=medium_power
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/default/tuned.conf new/tuned-2.6.0/profiles/default/tuned.conf
--- old/tuned-2.5.1/profiles/default/tuned.conf 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/profiles/default/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -2,6 +2,9 @@
# tuned configuration
#
+[main]
+summary=Legacy default tuned profile
+
[cpu]
[disk]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/desktop/tuned.conf new/tuned-2.6.0/profiles/desktop/tuned.conf
--- old/tuned-2.5.1/profiles/desktop/tuned.conf 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/profiles/desktop/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -3,6 +3,7 @@
#
[main]
+summary=Optmize for the desktop use-case
include=balanced
[sysctl]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/desktop-powersave/tuned.conf new/tuned-2.6.0/profiles/desktop-powersave/tuned.conf
--- old/tuned-2.5.1/profiles/desktop-powersave/tuned.conf 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/profiles/desktop-powersave/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -3,6 +3,7 @@
#
[main]
+summary=Optmize for the desktop use-case with power saving.
include=server-powersave
[video]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/enterprise-storage/tuned.conf new/tuned-2.6.0/profiles/enterprise-storage/tuned.conf
--- old/tuned-2.5.1/profiles/enterprise-storage/tuned.conf 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/profiles/enterprise-storage/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -3,4 +3,5 @@
#
[main]
+summary=Legacy profile for RHEL6. For RHEL7, please use throughput-performance profile.
include=throughput-performance
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/functions new/tuned-2.6.0/profiles/functions
--- old/tuned-2.5.1/profiles/functions 2015-05-19 15:47:23.000000000 +0200
+++ new/tuned-2.6.0/profiles/functions 2015-10-06 10:55:01.000000000 +0200
@@ -21,11 +21,22 @@
[ "$2" -a -e "${STORAGE}" ] && echo "$2" > "${STORAGE}/${1}${STORAGE_SUFFIX}"
}
+# Parse sysfs value, i.e. for "val1 [val2] val3" return "val2"
+# $0 SYSFS_NAME
+parse_sys() {
+ local V1 V2
+ [ -r "$1" ] || return
+ V1=`cat "$1"`
+ V2="${V1##*[}"
+ V2="${V2%%]*}"
+ echo "${V2:-$V1}"
+}
+
# Save sysfs value
# $0 STORAGE_NAME SYSFS_NAME
save_sys() {
[ "$#" -ne 2 ] && return
- [ -r "$2" -a ! -e "${STORAGE}/${1}${STORAGE_SUFFIX}" ] && cat "$2" > "${STORAGE}/${1}${STORAGE_SUFFIX}"
+ [ -r "$2" -a ! -e "${STORAGE}/${1}${STORAGE_SUFFIX}" ] && parse_sys "$2" > "${STORAGE}/${1}${STORAGE_SUFFIX}"
}
# Set sysfs value
@@ -105,7 +116,7 @@
# $0 DEVICES [ELEVATOR]
restore_elevator() {
re_elevator="$2"
- [ "$re_elevator" ] || re_elevator = cfq
+ [ "$re_elevator" ] || re_elevator=cfq
_set_elevator_helper restore_sys "$1" "$re_elevator"
}
@@ -440,7 +451,7 @@
}
restore_logs_syncing() {
- mv $RSYSLOG_SAVE $RSYSLOG_CFG
+ mv -Z $RSYSLOG_SAVE $RSYSLOG_CFG || mv $RSYSLOG_SAVE $RSYSLOG_CFG
}
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/laptop-ac-powersave/tuned.conf new/tuned-2.6.0/profiles/laptop-ac-powersave/tuned.conf
--- old/tuned-2.5.1/profiles/laptop-ac-powersave/tuned.conf 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/profiles/laptop-ac-powersave/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -3,6 +3,7 @@
#
[main]
+summary=Optimize for laptop with power savings
include=desktop-powersave
[script]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/laptop-battery-powersave/tuned.conf new/tuned-2.6.0/profiles/laptop-battery-powersave/tuned.conf
--- old/tuned-2.5.1/profiles/laptop-battery-powersave/tuned.conf 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/profiles/laptop-battery-powersave/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -3,4 +3,5 @@
#
[main]
+summary=Optimize laptop profile with more aggressive power saving
include=powersave
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/latency-performance/tuned.conf new/tuned-2.6.0/profiles/latency-performance/tuned.conf
--- old/tuned-2.5.1/profiles/latency-performance/tuned.conf 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/profiles/latency-performance/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -2,6 +2,9 @@
# tuned configuration
#
+[main]
+summary=Optimize for deterministic performance at the cost of increased power consumption
+
[cpu]
force_latency=1
governor=performance
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/network-latency/tuned.conf new/tuned-2.6.0/profiles/network-latency/tuned.conf
--- old/tuned-2.5.1/profiles/network-latency/tuned.conf 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/profiles/network-latency/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -3,6 +3,7 @@
#
[main]
+summary=Optimize for deterministic performance at the cost of increased power consumption, focused on low latency network performance
include=latency-performance
[vm]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/network-throughput/tuned.conf new/tuned-2.6.0/profiles/network-throughput/tuned.conf
--- old/tuned-2.5.1/profiles/network-throughput/tuned.conf 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/profiles/network-throughput/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -3,6 +3,7 @@
#
[main]
+summary=Optimize for streaming network throughput. Generally only necessary on older CPUs or 40G+ networks.
include=throughput-performance
[sysctl]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/oracle/tuned.conf new/tuned-2.6.0/profiles/oracle/tuned.conf
--- old/tuned-2.5.1/profiles/oracle/tuned.conf 2015-06-16 10:51:15.000000000 +0200
+++ new/tuned-2.6.0/profiles/oracle/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -3,6 +3,7 @@
#
[main]
+summary=Optimize for Oracle RDBMS
include=throughput-performance
[sysctl]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/powersave/tuned.conf new/tuned-2.6.0/profiles/powersave/tuned.conf
--- old/tuned-2.5.1/profiles/powersave/tuned.conf 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/profiles/powersave/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -2,6 +2,9 @@
# tuned configuration
#
+[main]
+summary=Optimize for low power consumption
+
[cpu]
governor=ondemand
energy_perf_bias=powersave
@@ -19,12 +22,14 @@
[disk]
# Comma separated list of devices, all devices if commented out.
# devices=sda
-alpm=min_power
[net]
# Comma separated list of devices, all devices if commented out.
# devices=eth0
+[scsi_host]
+alpm=min_power
+
[sysctl]
vm.laptop_mode=5
vm.dirty_writeback_centisecs=1500
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/realtime/tuned.conf new/tuned-2.6.0/profiles/realtime/tuned.conf
--- old/tuned-2.5.1/profiles/realtime/tuned.conf 2015-06-23 09:15:44.000000000 +0200
+++ new/tuned-2.6.0/profiles/realtime/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -4,6 +4,7 @@
# https://docs.redhat.com
[main]
+summary=Optimize for realtime workloads
include = network-latency
[variables]
@@ -20,6 +21,7 @@
[sysfs]
/sys/bus/workqueue/devices/writeback/cpumask = ${not_isolated_cpumask}
+/sys/devices/virtual/workqueue/cpumask = ${not_isolated_cpumask}
/sys/devices/system/machinecheck/machinecheck*/ignore_ce = 1
[bootloader]
@@ -27,7 +29,7 @@
# NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22
# NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23
-cmdline=isolcpus=${isolated_cores} nohz_full=${isolated_cores} intel_pstate=disable nosoftlockup
+cmdline=isolcpus=${isolated_cores} intel_pstate=disable nosoftlockup
[script]
script = script.sh
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/realtime-virtual-guest/tuned.conf new/tuned-2.6.0/profiles/realtime-virtual-guest/tuned.conf
--- old/tuned-2.5.1/profiles/realtime-virtual-guest/tuned.conf 2015-07-01 16:25:50.000000000 +0200
+++ new/tuned-2.6.0/profiles/realtime-virtual-guest/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -3,6 +3,7 @@
#
[main]
+summary=Optimize for realtime workloads running within a KVM guest
include=realtime
[variables]
@@ -12,3 +13,6 @@
[script]
script=script.sh
+
+[bootloader]
+cmdline=isolcpus=${isolated_cores} nohz=on nohz_full=${isolated_cores} intel_pstate=disable nosoftlockup
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/realtime-virtual-host/find-lapictscdeadline-optimal.sh new/tuned-2.6.0/profiles/realtime-virtual-host/find-lapictscdeadline-optimal.sh
--- old/tuned-2.5.1/profiles/realtime-virtual-host/find-lapictscdeadline-optimal.sh 2015-06-18 14:12:07.000000000 +0200
+++ new/tuned-2.6.0/profiles/realtime-virtual-host/find-lapictscdeadline-optimal.sh 2015-10-02 12:03:31.000000000 +0200
@@ -20,5 +20,11 @@
fi
prev_value=$a
done
+# if still decreasing, then use highest ns value
+if [ $value -le 99 ]; then
+ echo -n "optimal value for lapic_timer_advance_ns is: "
+ awk "NR==$(($i - 1))" $1 | cut -f 1 -d ":"
+ exit 0
+fi
echo optimal not found
exit 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/realtime-virtual-host/script.sh new/tuned-2.6.0/profiles/realtime-virtual-host/script.sh
--- old/tuned-2.5.1/profiles/realtime-virtual-host/script.sh 2015-07-24 11:06:29.000000000 +0200
+++ new/tuned-2.6.0/profiles/realtime-virtual-host/script.sh 2015-11-16 17:25:58.000000000 +0100
@@ -27,7 +27,7 @@
curmodel=`cat /proc/cpuinfo | grep "model name" | cut -f 2 -d ":" | uniq`
genmodel=`cat lapic_timer_adv_ns.cpumodel`
- if [ "$cpumodel" != "$genmodel" ]; then
+ if [ "$curmodel" != "$genmodel" ]; then
rm -f lapic_timer_adv_ns
rm -f lapic_timer_adv_ns.cpumodel
fi
@@ -43,7 +43,7 @@
if [ $? -eq 0 ]; then
echo `cat $tempdir/opt.out | cut -f 2 -d ":"` > ./lapic_timer_adv_ns
curmodel=`cat /proc/cpuinfo | grep "model name" | cut -f 2 -d ":" | uniq`
- echo $curmodel > lapic_timer_adv_ns.cpumodel
+ echo "$curmodel" > lapic_timer_adv_ns.cpumodel
fi
fi
fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/realtime-virtual-host/tuned.conf new/tuned-2.6.0/profiles/realtime-virtual-host/tuned.conf
--- old/tuned-2.5.1/profiles/realtime-virtual-host/tuned.conf 2015-07-01 16:24:07.000000000 +0200
+++ new/tuned-2.6.0/profiles/realtime-virtual-host/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -20,6 +20,7 @@
[main]
+summary=Optimize for KVM guests running realtime workloads
include=realtime
[variables]
@@ -40,3 +41,6 @@
[script]
script=script.sh
+
+[bootloader]
+cmdline=isolcpus=${isolated_cores} nohz=on nohz_full=${isolated_cores} intel_pstate=disable nosoftlockup
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/sap-hana/tuned.conf new/tuned-2.6.0/profiles/sap-hana/tuned.conf
--- old/tuned-2.5.1/profiles/sap-hana/tuned.conf 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/profiles/sap-hana/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -3,6 +3,7 @@
#
[main]
+summary=Optimize for SAP
include=throughput-performance
[cpu]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/sap-hana-vmware/tuned.conf new/tuned-2.6.0/profiles/sap-hana-vmware/tuned.conf
--- old/tuned-2.5.1/profiles/sap-hana-vmware/tuned.conf 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/profiles/sap-hana-vmware/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -3,6 +3,7 @@
#
[main]
+summary=Optimize for SAP running inside a VMware guest
include=throughput-performance
[cpu]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/sap-netweaver/tuned.conf new/tuned-2.6.0/profiles/sap-netweaver/tuned.conf
--- old/tuned-2.5.1/profiles/sap-netweaver/tuned.conf 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/profiles/sap-netweaver/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -3,6 +3,7 @@
#
[main]
+summary=Optimize for SAP NetWeaver
include=throughput-performance
[sysctl]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/server-powersave/tuned.conf new/tuned-2.6.0/profiles/server-powersave/tuned.conf
--- old/tuned-2.5.1/profiles/server-powersave/tuned.conf 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/profiles/server-powersave/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -2,7 +2,12 @@
# tuned configuration
#
+[main]
+summary=Optimize for server power savings
+
[cpu]
[disk]
+
+[scsi_host]
alpm=min_power
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/spindown-disk/tuned.conf new/tuned-2.6.0/profiles/spindown-disk/tuned.conf
--- old/tuned-2.5.1/profiles/spindown-disk/tuned.conf 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/profiles/spindown-disk/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -16,11 +16,16 @@
# Bluetooth will be switch off.
# Wifi will be switch into power safe mode.
+[main]
+summary=Optimize for power saving by spinning-down rotational disks
+
[disk]
-alpm=medium_power
apm=128
spindown=6
+[scsi_host]
+alpm=medium_power
+
[sysctl]
vm.dirty_writeback_centisecs=6000
vm.dirty_expire_centisecs=9000
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/throughput-performance/tuned.conf new/tuned-2.6.0/profiles/throughput-performance/tuned.conf
--- old/tuned-2.5.1/profiles/throughput-performance/tuned.conf 2015-06-26 12:12:24.000000000 +0200
+++ new/tuned-2.6.0/profiles/throughput-performance/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -2,6 +2,9 @@
# tuned configuration
#
+[main]
+summary=Broadly applicable tuning that provides excellent performance across a variety of common server workloads. This is the default profile for RHEL7.
+
[cpu]
governor=performance
energy_perf_bias=performance
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/virtual-guest/tuned.conf new/tuned-2.6.0/profiles/virtual-guest/tuned.conf
--- old/tuned-2.5.1/profiles/virtual-guest/tuned.conf 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/profiles/virtual-guest/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -3,6 +3,7 @@
#
[main]
+summary=Optimize for running inside a virtual guest.
include=throughput-performance
[sysctl]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/profiles/virtual-host/tuned.conf new/tuned-2.6.0/profiles/virtual-host/tuned.conf
--- old/tuned-2.5.1/profiles/virtual-host/tuned.conf 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/profiles/virtual-host/tuned.conf 2015-12-18 17:21:00.000000000 +0100
@@ -3,6 +3,7 @@
#
[main]
+summary=Optimize for running KVM guests
include=throughput-performance
[sysctl]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/tuned/admin/admin.py new/tuned-2.6.0/tuned/admin/admin.py
--- old/tuned-2.5.1/tuned/admin/admin.py 2015-07-10 16:41:03.000000000 +0200
+++ new/tuned-2.6.0/tuned/admin/admin.py 2016-01-05 11:15:40.000000000 +0100
@@ -11,6 +11,7 @@
self._controller = controller
self._debug = debug
self._cmd = commands(debug)
+ self._profiles_locator = profiles_locator(consts.LOAD_DIRECTORIES)
def _error(self, message):
print >>sys.stderr, message
@@ -28,18 +29,27 @@
no_dbus = self._controller is None
if not no_dbus:
try:
- profile_names = self._controller.profiles()
+ profile_names = self._controller.profiles2()
except TunedAdminDBusException as e:
- self._error(e)
- no_dbus = True
+ # fallback to older API
+ try:
+ profile_names = self._controller.profiles()
+ except TunedAdminDBusException as e:
+ self._error(e)
+ no_dbus = True
+ profile_names = map(lambda profile:(profile, ""), profile_names)
if no_dbus:
- profile_names = profiles_locator(consts.LOAD_DIRECTORIES).get_known_names()
+ profile_names = self._profiles_locator.get_known_names_summary()
print "Available profiles:"
for profile in profile_names:
- print "- %s" % profile
+ if profile[1] is not None and profile[1] != "":
+ print self._cmd.align_str("- %s" % profile[0], 30, "- %s" % profile[1])
+ else:
+ print "- %s" % profile[0]
self.active()
- def active(self):
+ def _get_active_profile(self):
+ profile_name = None
no_dbus = self._controller is None
if not no_dbus:
try:
@@ -49,7 +59,39 @@
no_dbus = True
if no_dbus:
profile_name = str.strip(self._cmd.read_file(consts.ACTIVE_PROFILE_FILE, None))
- if profile_name is not None and profile_name != "":
+ if profile_name == "":
+ profile_name = None
+ return profile_name
+
+ def profile_info(self, profile = ""):
+ no_dbus = self._controller is None
+ if profile == "":
+ profile = self._get_active_profile()
+ if not no_dbus:
+ try:
+ ret = self._controller.profile_info(profile)
+ except TunedAdminDBusException as e:
+ self._error(e)
+ no_dbus = True
+ if no_dbus:
+ ret = self._profiles_locator.get_profile_attrs(profile, [consts.PROFILE_ATTR_SUMMARY, consts.PROFILE_ATTR_DESCRIPTION], ["", ""])
+ if ret[0] == True:
+ print "Profile name:"
+ print ret[1]
+ print
+ print "Profile summary:"
+ print ret[2]
+ print
+ print "Profile description:"
+ print ret[3]
+ return True
+ else:
+ print "Unable to get information about profile '%s'" % profile
+ return False
+
+ def active(self):
+ profile_name = self._get_active_profile()
+ if profile_name is not None:
if self._controller is not None and self._tuned_is_running():
print "Current active profile: %s" % profile_name
else:
@@ -73,11 +115,11 @@
self._error(e)
no_dbus = True
if no_dbus:
- if profile_name in profiles_locator(consts.LOAD_DIRECTORIES).get_known_names():
+ if profile_name in self._profiles_locator.get_known_names():
if self._cmd.write_to_file(consts.ACTIVE_PROFILE_FILE, profile_name):
print "Trying to (re)start tuned..."
(ret, out) = self._cmd.execute(["service", "tuned", "restart"])
- if retcode == 0:
+ if ret == 0:
print "Tuned (re)started, changes applied."
else:
print "Tuned (re)start failed, you need to (re)start tuned by hand for changes to apply."
@@ -125,8 +167,9 @@
print "Verfication succeeded, current system settings match the preset profile."
else:
print "Verification failed, current system settings differ from the preset profile."
- print "See tuned.log for details. You can mostly fix this by Tuned restart, e.g.:"
+ print "You can mostly fix this by Tuned restart, e.g.:"
print " service tuned restart"
+ print "See tuned log file ('%s') for details." % consts.LOG_FILE
return ret
def off(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/tuned/admin/dbus_controller.py new/tuned-2.6.0/tuned/admin/dbus_controller.py
--- old/tuned-2.5.1/tuned/admin/dbus_controller.py 2015-05-18 18:46:29.000000000 +0200
+++ new/tuned-2.6.0/tuned/admin/dbus_controller.py 2016-01-04 18:05:52.000000000 +0100
@@ -44,6 +44,12 @@
def profiles(self):
return self._call("profiles")
+ def profiles2(self):
+ return self._call("profiles2")
+
+ def profile_info(self, profile_name):
+ return self._call("profile_info", profile_name)
+
def active_profile(self):
return self._call("active_profile")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/tuned/consts.py new/tuned-2.6.0/tuned/consts.py
--- old/tuned-2.5.1/tuned/consts.py 2015-07-02 14:37:48.000000000 +0200
+++ new/tuned-2.6.0/tuned/consts.py 2015-12-22 16:55:11.000000000 +0100
@@ -1,5 +1,6 @@
GLOBAL_CONFIG_FILE = "/etc/tuned/tuned-main.conf"
ACTIVE_PROFILE_FILE = "/etc/tuned/active_profile"
+PROFILE_FILE = "tuned.conf"
AUTODETECT_FILE = "recommend.conf"
DAEMONIZE_PARENT_TIMEOUT = 5
DBUS_BUS = "com.redhat.tuned"
@@ -56,6 +57,10 @@
# recommend command availability
CFG_DEF_RECOMMEND_COMMAND = True
+# profile attributes which can be specified in the main section
+PROFILE_ATTR_SUMMARY = "summary"
+PROFILE_ATTR_DESCRIPTION = "description"
+
STR_VERIFY_PROFILE_DEVICE_VALUE_OK = "verify: passed: device %s: %s = %s"
STR_VERIFY_PROFILE_VALUE_OK = "verify: passed: %s = %s"
STR_VERIFY_PROFILE_OK = "verify: passed: %s"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/tuned/daemon/controller.py new/tuned-2.6.0/tuned/daemon/controller.py
--- old/tuned-2.5.1/tuned/daemon/controller.py 2015-07-02 16:57:20.000000000 +0200
+++ new/tuned-2.6.0/tuned/daemon/controller.py 2016-01-05 11:15:16.000000000 +0100
@@ -106,6 +106,16 @@
def profiles(self):
return self._daemon.profile_loader.profile_locator.get_known_names()
+ @exports.export("", "a(ss)")
+ def profiles2(self):
+ return self._daemon.profile_loader.profile_locator.get_known_names_summary()
+
+ @exports.export("s", "(bsss)")
+ def profile_info(self, profile_name):
+ if profile_name is None or profile_name == "":
+ profile_name = self.active_profile()
+ return tuple(self._daemon.profile_loader.profile_locator.get_profile_attrs(profile_name, [consts.PROFILE_ATTR_SUMMARY, consts.PROFILE_ATTR_DESCRIPTION], [""]))
+
@exports.export("", "s")
def recommend_profile(self):
return self._cmd.recommend_profile(hardcoded = not self._global_config.get_bool(consts.CFG_RECOMMEND_COMMAND, consts.CFG_DEF_RECOMMEND_COMMAND))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/tuned/gtk/gui_profile_loader.py new/tuned-2.6.0/tuned/gtk/gui_profile_loader.py
--- old/tuned-2.5.1/tuned/gtk/gui_profile_loader.py 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/tuned/gtk/gui_profile_loader.py 2015-10-27 17:54:50.000000000 +0100
@@ -47,7 +47,7 @@
def get_raw_profile(self, profile_name):
file = self._locate_profile_path(profile_name) + '/' \
- + profile_name + '/' + 'tuned.conf'
+ + profile_name + '/' + tuned.consts.PROFILE_FILE
with open(file, 'r') as f:
return f.read()
@@ -56,7 +56,7 @@
profilePath = self._locate_profile_path(profile_name)
if profilePath == tuned.consts.LOAD_DIRECTORIES[1]:
- file = profilePath + '/' + profile_name + '/' + 'tuned.conf'
+ file = profilePath + '/' + profile_name + '/' + tuned.consts.PROFILE_FILE
with open(file, 'w') as f:
f.write(config)
else:
@@ -65,7 +65,7 @@
+ ' and can not be storet do this location')
def load_profile_config(self, profile_name, path):
- conf_path = path + '/' + profile_name + '/tuned.conf'
+ conf_path = path + '/' + profile_name + '/' + tuned.consts.PROFILE_FILE
profile_config = configobj.ConfigObj(conf_path)
return profile_config
@@ -99,7 +99,7 @@
def save_profile(self, profile):
path = tuned.consts.LOAD_DIRECTORIES[1] + '/' + profile.name
config = configobj.ConfigObj()
- config.filename = path + tuned.consts.CONF_PROFILE_FILE
+ config.filename = path + '/' + tuned.consts.PROFILE_FILE
config.initial_comment = ('#', 'tuned configuration', '#')
try:
@@ -146,7 +146,7 @@
self.remove_profile(old_profile_name, is_admin=is_admin)
config = configobj.ConfigObj()
- config.filename = path + '/tuned.conf'
+ config.filename = path + '/' + tuned.consts.PROFILE_FILE
config.initial_comment = ('#', 'tuned configuration', '#')
try:
config['main'] = profile.options
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/tuned/plugins/base.py new/tuned-2.6.0/tuned/plugins/base.py
--- old/tuned-2.5.1/tuned/plugins/base.py 2015-06-18 12:22:03.000000000 +0200
+++ new/tuned-2.6.0/tuned/plugins/base.py 2015-08-19 14:06:12.000000000 +0200
@@ -3,6 +3,7 @@
import tuned.profiles.variables
import tuned.logs
import collections
+from tuned.utils.commands import commands
log = tuned.logs.get()
@@ -35,6 +36,8 @@
self._options_used_by_dynamic = self._get_config_options_used_by_dynamic()
+ self._cmd = commands()
+
def cleanup(self):
self.destroy_instances()
@@ -415,10 +418,10 @@
command["set"](new_value, sim = False)
def _norm_value(self, value):
- v = str(value)
+ v = self._cmd.unquote(str(value))
if re.match(r'\s*(0+,)+[\da-fA-F]*\s*$', v):
return re.sub(r'^\s*(0+,)+', "", v)
- return value
+ return v
def _verify_value(self, name, new_value, current_value, device = None):
if new_value is None:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/tuned/plugins/plugin_bootloader.py new/tuned-2.6.0/tuned/plugins/plugin_bootloader.py
--- old/tuned-2.5.1/tuned/plugins/plugin_bootloader.py 2015-07-24 13:47:54.000000000 +0200
+++ new/tuned-2.6.0/tuned/plugins/plugin_bootloader.py 2015-08-19 13:41:06.000000000 +0200
@@ -105,9 +105,6 @@
self._grub2_default_env_patch()
return True
- def _unquote(self, v):
- return re.sub("^\"(.*)\"$", r"\1", v)
-
@command_custom("grub2_cfg_file")
def _grub2_cfg_file(self, enabling, value, verify):
# nothing to verify
@@ -118,7 +115,7 @@
@command_custom("cmdline", per_device = False, priority = 10)
def _cmdline(self, enabling, value, verify):
- v = self._variables.expand(self._unquote(value))
+ v = self._variables.expand(self._cmd.unquote(value))
if verify:
cmdline = self._cmd.read_file("/proc/cmdline")
if len(cmdline) == 0:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/tuned/plugins/plugin_cpu.py new/tuned-2.6.0/tuned/plugins/plugin_cpu.py
--- old/tuned-2.5.1/tuned/plugins/plugin_cpu.py 2015-06-10 14:27:06.000000000 +0200
+++ new/tuned-2.6.0/tuned/plugins/plugin_cpu.py 2015-08-21 14:36:49.000000000 +0200
@@ -5,6 +5,7 @@
import os
import struct
+import errno
log = tuned.logs.get()
@@ -52,19 +53,19 @@
}
def _check_cpupower(self):
- if self._cmd.execute(["cpupower", "frequency-info"])[0] == 0:
+ if self._cmd.execute(["cpupower", "frequency-info"], no_errors = [errno.ENOENT])[0] == 0:
self._has_cpupower = True
else:
self._has_cpupower = False
- log.warning("using sysfs fallback, is cpupower installed?")
+ log.warning("unable to run cpupower tool, using sysfs fallback, is cpupower installed?")
def _check_energy_perf_bias(self):
self._has_energy_perf_bias = False
- retcode = self._cmd.execute(["x86_energy_perf_policy", "-r"])[0]
+ retcode = self._cmd.execute(["x86_energy_perf_policy", "-r"], no_errors = [errno.ENOENT])[0]
if retcode == 0:
self._has_energy_perf_bias = True
elif retcode == -1:
- log.warning("error executing x86_energy_perf_policy tool, ignoring CPU energy performance bias, is the tool installed?")
+ log.warning("unable to run x86_energy_perf_policy tool, ignoring CPU energy performance bias, is the tool installed?")
else:
log.warning("your CPU doesn't support MSR_IA32_ENERGY_PERF_BIAS, ignoring CPU energy performance bias")
@@ -123,12 +124,21 @@
if instance._load_monitor is not None:
self._monitors_repository.delete(instance._load_monitor)
- def _instance_apply_static(self, instance):
- if instance._first_instance and self._has_intel_pstate:
- self._min_perf_pct_save = self._get_intel_pstate_attr("min_perf_pct")
- self._max_perf_pct_save = self._get_intel_pstate_attr("max_perf_pct")
- self._no_turbo_save = self._get_intel_pstate_attr("no_turbo")
+ def _get_intel_pstate_attr(self, attr):
+ return self._cmd.read_file("/sys/devices/system/cpu/intel_pstate/%s" % attr, None).strip()
+
+ def _set_intel_pstate_attr(self, attr, val):
+ if val is not None:
+ self._cmd.write_to_file("/sys/devices/system/cpu/intel_pstate/%s" % attr, val)
+
+ def _getset_intel_pstate_attr(self, attr, value):
+ if value is None:
+ return None
+ v = self._get_intel_pstate_attr(attr)
+ self._set_intel_pstate_attr(attr, value)
+ return v
+ def _instance_apply_static(self, instance):
super(self.__class__, self)._instance_apply_static(instance)
if not instance._first_instance:
@@ -138,9 +148,9 @@
if force_latency_value is not None:
self._set_latency(force_latency_value)
if self._has_intel_pstate:
- self._set_intel_pstate_attr("min_perf_pct", instance.options["min_perf_pct"])
- self._set_intel_pstate_attr("max_perf_pct", instance.options["max_perf_pct"])
- self._set_intel_pstate_attr("no_turbo", instance.options["no_turbo"])
+ self._min_perf_pct_save = self._getset_intel_pstate_attr("min_perf_pct", instance.options["min_perf_pct"])
+ self._max_perf_pct_save = self._getset_intel_pstate_attr("max_perf_pct", instance.options["max_perf_pct"])
+ self._no_turbo_save = self._getset_intel_pstate_attr("no_turbo", instance.options["no_turbo"])
def _instance_unapply_static(self, instance, profile_switch = False):
super(self.__class__, self)._instance_unapply_static(instance, profile_switch)
@@ -167,13 +177,6 @@
def _instance_unapply_dynamic(self, instance, device):
pass
- def _get_intel_pstate_attr(self, attr):
- return self._cmd.read_file("/sys/devices/system/cpu/intel_pstate/%s" % attr, None).strip()
-
- def _set_intel_pstate_attr(self, attr, val):
- if val is not None:
- self._cmd.write_to_file("/sys/devices/system/cpu/intel_pstate/%s" % attr, val)
-
def _set_latency(self, latency):
latency = int(latency)
if self._latency != latency:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/tuned/plugins/plugin_disk.py new/tuned-2.6.0/tuned/plugins/plugin_disk.py
--- old/tuned-2.5.1/tuned/plugins/plugin_disk.py 2015-06-25 11:17:50.000000000 +0200
+++ new/tuned-2.6.0/tuned/plugins/plugin_disk.py 2015-08-24 14:23:22.000000000 +0200
@@ -1,5 +1,4 @@
import errno
-import tuned.consts as consts
import hotplug
from decorators import *
import tuned.logs
@@ -65,7 +64,6 @@
return {
"dynamic" : True, # FIXME: do we want this default?
"elevator" : None,
- "alpm" : None,
"apm" : None,
"spindown" : None,
"readahead" : None,
@@ -217,39 +215,6 @@
# noop deadline [cfq]
return self._cmd.get_active_option(self._cmd.read_file(sys_file))
- def _alpm_policy_files(self):
- policy_files = []
- for host in os.listdir("/sys/class/scsi_host/"):
- port_cmd_path = os.path.join("/sys/class/scsi_host/", host, "ahci_port_cmd")
- try:
- port_cmd = open(port_cmd_path).read().strip()
- except (OSError,IOError) as e:
- log.error("Reading %s error: %s" % (port_cmd_path, e))
- continue
- try:
- port_cmd_int = int("0x" + port_cmd, 16)
- except ValueError:
- log.error("Unexpected value in %s" % (port_cmd_path))
- continue
-
- policy_file = os.path.join("/sys/class/scsi_host/", host, "link_power_management_policy")
- policy_files.append(policy_file)
-
- return policy_files
-
- @command_set("alpm")
- def _set_alpm(self, policy, sim):
- if not sim:
- for policy_file in self._alpm_policy_files():
- self._cmd.write_to_file(policy_file, policy)
- return policy
-
- @command_get("alpm")
- def _get_alpm(self):
- for policy_file in self._alpm_policy_files():
- return self._cmd.read_file(policy_file).strip()
- return None
-
@command_set("apm", per_device=True)
def _set_apm(self, value, device, sim):
if self._apm_errcnt < consts.ERROR_THRESHOLD:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/tuned/plugins/plugin_scsi_host.py new/tuned-2.6.0/tuned/plugins/plugin_scsi_host.py
--- old/tuned-2.5.1/tuned/plugins/plugin_scsi_host.py 1970-01-01 01:00:00.000000000 +0100
+++ new/tuned-2.6.0/tuned/plugins/plugin_scsi_host.py 2015-08-24 16:16:23.000000000 +0200
@@ -0,0 +1,83 @@
+import errno
+import hotplug
+from decorators import *
+import tuned.logs
+import tuned.consts as consts
+from tuned.utils.commands import commands
+import os
+import re
+
+log = tuned.logs.get()
+
+class DiskPlugin(hotplug.Plugin):
+ """
+ Plugin for tuning options of SCSI hosts.
+ """
+
+ def __init__(self, *args, **kwargs):
+ super(self.__class__, self).__init__(*args, **kwargs)
+
+ self._cmd = commands()
+
+ def _init_devices(self):
+ self._devices = set()
+ for device in self._hardware_inventory.get_devices("scsi"):
+ if self._device_is_supported(device):
+ self._devices.add(device.sys_name)
+
+ self._assigned_devices = set()
+ self._free_devices = self._devices.copy()
+
+ def _device_is_supported(cls, device):
+ return device.device_type == "scsi_host"
+
+ def _hardware_events_init(self):
+ self._hardware_inventory.subscribe(self, "scsi", self._hardware_events_callback)
+
+ def _hardware_events_cleanup(self):
+ self._hardware_inventory.unsubscribe(self)
+
+ def _hardware_events_callback(self, event, device):
+ if self._device_is_supported(device):
+ super(self.__class__, self)._hardware_events_callback(event, device)
+
+ def _added_device_apply_tuning(self, instance, device_name):
+ super(self.__class__, self)._added_device_apply_tuning(instance, device_name)
+
+ def _removed_device_unapply_tuning(self, instance, device_name):
+ super(self.__class__, self)._removed_device_unapply_tuning(instance, device_name)
+
+ @classmethod
+ def _get_config_options(cls):
+ return {
+ "alpm" : None,
+ }
+
+ def _instance_init(self, instance):
+ instance._has_static_tuning = True
+ instance._has_dynamic_tuning = False
+
+ def _instance_cleanup(self, instance):
+ pass
+
+ def _get_alpm_policy_file(self, device):
+ return os.path.join("/sys/class/scsi_host/", str(device), "link_power_management_policy")
+
+ @command_set("alpm", per_device = True)
+ def _set_alpm(self, policy, device, sim):
+ if policy is None:
+ return None
+ policy_file = self._get_alpm_policy_file(device)
+ if not sim:
+ if os.path.exists(policy_file):
+ self._cmd.write_to_file(policy_file, policy)
+ else:
+ log.warn("ALPM control file ('%s') not found, skipping ALPM setting for '%s'" % (policy_file, str(device)))
+ return None
+ return policy
+
+ @command_get("alpm")
+ def _get_alpm(self, device):
+ policy_file = self._get_alpm_policy_file(device)
+ policy = self._cmd.read_file(policy_file).strip()
+ return policy if policy != "" else None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/tuned/plugins/plugin_sysctl.py new/tuned-2.6.0/tuned/plugins/plugin_sysctl.py
--- old/tuned-2.5.1/tuned/plugins/plugin_sysctl.py 2015-06-01 19:08:23.000000000 +0200
+++ new/tuned-2.6.0/tuned/plugins/plugin_sysctl.py 2015-11-16 18:20:53.000000000 +0100
@@ -43,7 +43,7 @@
original_value = self._read_sysctl(option)
if original_value != None:
instance._sysctl_original[option] = original_value
- self._write_sysctl(option, self._variables.expand(value))
+ self._write_sysctl(option, self._variables.expand(self._cmd.unquote(value)))
self._storage.set("options", instance._sysctl_original)
@@ -51,8 +51,12 @@
ret = True
for option, value in instance._sysctl.iteritems():
curr_val = self._read_sysctl(option)
- if self._verify_value(option, self._cmd.remove_ws(self._variables.expand(value)), curr_val) == False:
- ret = False
+ if curr_val is None:
+ log.warn("verify: option '%s' is None, option is probably unavailable/unsupported on your system, skipping it",
+ str(option))
+ else:
+ if self._verify_value(option, self._cmd.remove_ws(self._variables.expand(value)), curr_val) == False:
+ ret = False
return ret
def _instance_unapply_static(self, instance, profile_switch = False):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/tuned/profiles/locator.py new/tuned-2.6.0/tuned/profiles/locator.py
--- old/tuned-2.5.1/tuned/profiles/locator.py 2015-05-04 11:06:33.000000000 +0200
+++ new/tuned-2.6.0/tuned/profiles/locator.py 2016-01-05 11:23:07.000000000 +0100
@@ -1,4 +1,6 @@
import os
+import tuned.consts as consts
+from configobj import ConfigObj, ConfigObjError
class Locator(object):
"""
@@ -23,7 +25,8 @@
def get_config(self, profile_name, skip_files=None):
for dir_name in reversed(self._load_directories):
- config_file = self._get_config_filename(dir_name, profile_name)
+ # basename is protection not to get out of the path
+ config_file = self._get_config_filename(dir_name, os.path.basename(profile_name))
if skip_files is not None and config_file in skip_files:
continue
@@ -33,7 +36,57 @@
return None
- def get_known_names(self):
+ def check_profile_name_format(self, profile_name):
+ return profile_name is not None and profile_name != "" and "/" not in profile_name
+
+ def parse_config(self, profile_name):
+ if not self.check_profile_name_format(profile_name):
+ return None
+ config_file = self.get_config(profile_name)
+ if config_file is None:
+ return None
+ try:
+ return ConfigObj(config_file, list_values = False, interpolation = False)
+ except (IOError, OSError, ConfigObjError) as e:
+ return None
+
+ # Get profile attributes (e.g. summary, description), attrs is list of requested attributes,
+ # if it is not list it is converted to list, defvals is list of default values to return if
+ # attribute is not found, it is also converted to list if it is not list.
+ # Returns list of the following format [status, profile_name, attr1_val, attr2_val, ...],
+ # status is boolean.
+ def get_profile_attrs(self, profile_name, attrs, defvals = None):
+ # check types
+ try:
+ attrs_len = len(attrs)
+ except TypeError:
+ attrs = [attrs]
+ attrs_len = 1
+ try:
+ defvals_len = len(defvals)
+ except TypeError:
+ defvals = [defvals]
+ defvals_len = 1
+ # Extend defvals if needed, last value is used for extension
+ if defvals_len < attrs_len:
+ defvals = defvals + ([defvals[-1]] * (attrs_len - defvals_len))
+ config = self.parse_config(profile_name)
+ if config is None:
+ return [False, "", "", ""]
+ if config.has_key("main"):
+ d = config["main"]
+ else:
+ d = dict()
+ vals = [True, profile_name]
+ for (attr, defval) in zip(attrs, defvals):
+ if attr == "" or attr is None:
+ vals[0] = False
+ vals = vals + [""]
+ else:
+ vals = vals + [d.get(attr, defval)]
+ return vals
+
+ def list_profiles(self):
profiles = set()
for dir_name in self._load_directories:
try:
@@ -43,5 +96,10 @@
profiles.add(profile_name)
except OSError:
pass
+ return profiles
+
+ def get_known_names(self):
+ return sorted(self.list_profiles())
- return sorted(list(profiles))
+ def get_known_names_summary(self):
+ return map(lambda profile: (profile, self.get_profile_attrs(profile, [consts.PROFILE_ATTR_SUMMARY], [""])[2]), sorted(self.list_profiles()))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/tuned/utils/commands.py new/tuned-2.6.0/tuned/utils/commands.py
--- old/tuned-2.5.1/tuned/utils/commands.py 2015-07-31 18:24:47.000000000 +0200
+++ new/tuned-2.6.0/tuned/utils/commands.py 2016-01-04 18:22:35.000000000 +0100
@@ -30,6 +30,13 @@
def remove_ws(self, s):
return re.sub('\s+', ' ', s).strip()
+ def unquote(self, v):
+ return re.sub("^\"(.*)\"$", r"\1", v)
+
+ # add spaces to align s2 to pos, returns resulting string: s1 + spaces + s2
+ def align_str(self, s1, pos, s2):
+ return s1 + " " * (pos - len(s1)) + s2
+
# convert dictionary 'd' to flat list and return it
# it uses sort on the dictionary items to return consistent results
# for directories with different inserte/delete history
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/tuned/version.py new/tuned-2.6.0/tuned/version.py
--- old/tuned-2.5.1/tuned/version.py 2015-08-04 09:00:32.000000000 +0200
+++ new/tuned-2.6.0/tuned/version.py 2016-01-05 16:06:46.000000000 +0100
@@ -1,3 +1,3 @@
TUNED_VERSION_MAJOR = 2
-TUNED_VERSION_MINOR = 5
-TUNED_VERSION_PATCH = 1
+TUNED_VERSION_MINOR = 6
+TUNED_VERSION_PATCH = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/tuned-adm.py new/tuned-2.6.0/tuned-adm.py
--- old/tuned-2.5.1/tuned-adm.py 2015-07-02 14:37:32.000000000 +0200
+++ new/tuned-2.6.0/tuned-adm.py 2016-01-04 16:46:19.000000000 +0100
@@ -47,6 +47,10 @@
parser_profile.set_defaults(action="profile")
parser_profile.add_argument("profiles", metavar="profile", type=str, nargs="+", help="profile name")
+ parser_profile_info = subparsers.add_parser("profile_info", help="show information/description of given profile or current profile if no profile is specified")
+ parser_profile_info.set_defaults(action="profile_info")
+ parser_profile_info.add_argument("profile", metavar="profile", type=str, nargs="?", default="", help="profile name, current profile if not specified")
+
if config.get(consts.CFG_RECOMMEND_COMMAND, consts.CFG_DEF_RECOMMEND_COMMAND):
parser_off = subparsers.add_parser("recommend", help="recommend profile")
parser_off.set_defaults(action="recommend_profile")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tuned-2.5.1/tuned.spec new/tuned-2.6.0/tuned.spec
--- old/tuned-2.5.1/tuned.spec 2015-08-04 09:09:11.000000000 +0200
+++ new/tuned-2.6.0/tuned.spec 2016-01-05 16:06:36.000000000 +0100
@@ -10,7 +10,7 @@
Summary: A dynamic adaptive system tuning daemon
Name: tuned
-Version: 2.5.1
+Version: 2.6.0
Release: 1%{?with_snapshot:.%{git_suffix}}%{?dist}
License: GPLv2+
Source: https://fedorahosted.org/releases/t/u/tuned/tuned-%{version}.tar.bz2
@@ -106,7 +106,8 @@
%package profiles-nfv
Summary: Additional tuned profile(s) targeted to Network Function Virtualization (NFV)
-Requires: %{name} = %{version}-%{release}, %{name}-profiles-realtime = %{version}-%{release}
+Requires: %{name} = %{version}-%{release}
+Requires: %{name}-profiles-realtime = %{version}-%{release}
Requires: tuna, qemu-kvm-tools-rhev
%description profiles-nfv
@@ -146,8 +147,10 @@
sed -i 's|.*/\([^/]\+\)/[^\.]\+\.conf|\1|' /etc/tuned/active_profile
# convert GRUB_CMDLINE_LINUX to GRUB_CMDLINE_LINUX_DEFAULT
-sed -i 's/GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX \\$tuned_params"/GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT \\$tuned_params"/' \
- %{_sysconfdir}/default/grub
+if [ -r "%{_sysconfdir}/default/grub" ]; then
+ sed -i 's/GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX \\$tuned_params"/GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT \\$tuned_params"/' \
+ %{_sysconfdir}/default/grub
+fi
%preun
@@ -162,7 +165,9 @@
if [ "$1" == 0 ]; then
rm -f %{_sysconfdir}/grub.d/00_tuned || :
# unpatch /etc/default/grub
- sed -i '/GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT \\$tuned_params"/d' %{_sysconfdir}/default/grub
+ if [ -r "%{_sysconfdir}/default/grub" ]; then
+ sed -i '/GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT:+$GRUB_CMDLINE_LINUX_DEFAULT }\\$tuned_params"/d' %{_sysconfdir}/default/grub
+ fi
fi
@@ -182,10 +187,9 @@
%files
%defattr(-,root,root,-)
-%doc AUTHORS
-%doc COPYING
-%doc README
-%doc doc/TIPS.txt
+%exclude %{docdir}/README.utils
+%exclude %{docdir}/README.scomes
+%doc %{docdir}
%{_datadir}/bash-completion/completions/tuned-adm
%exclude %{python_sitelib}/tuned/gtk
%{python_sitelib}/tuned
@@ -300,6 +304,44 @@
%{_mandir}/man7/tuned-profiles-compat.7*
%changelog
+* Tue Jan 5 2016 Jaroslav Škarvada
participants (1)
-
root@hilbert.suse.de