diff --git a/.gitignore b/.gitignore index 37b5c38..ed0b8c4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/tuned-2.3.0.tar.bz2 +SOURCES/tuned-2.4.1.tar.bz2 diff --git a/.tuned.metadata b/.tuned.metadata index 1328a39..60b85a9 100644 --- a/.tuned.metadata +++ b/.tuned.metadata @@ -1 +1 @@ -e0bcdb54215e38738f9a0e564d3309476b8545bd SOURCES/tuned-2.3.0.tar.bz2 +fe8c50ef57407de6f8c4637e3548c0eb86ea174f SOURCES/tuned-2.4.1.tar.bz2 diff --git a/SOURCES/tuned-2.3.0-assignment-modifiers.patch b/SOURCES/tuned-2.3.0-assignment-modifiers.patch deleted file mode 100644 index 62d3262..0000000 --- a/SOURCES/tuned-2.3.0-assignment-modifiers.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 1d1c3a389c393afa1e88d5629f5dff85824fc92b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= -Date: Wed, 7 May 2014 17:02:59 +0200 -Subject: tuned: Added support for >, < assignment modifiers in tuned.conf -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -These modifiers can specify when to assign new value considering -the old value. - -E.g.: -readahead=>4096 - -means assign readahead 4096 only if the current value of readahaed -is lower than 4096 (i.e. the readahaed will be at least 4096). - -Similarly for the < operator, it will assign the value only -if the current value is higher. - -The modifiers are part of the value, not part of the equality -operator, thus the following is correct: -readahead= >4096 - -But the following isn't correct, but will probably also work -due to the nature how the value is parsed: -readahead=> 4096 - -Signed-off-by: Jaroslav Škarvada - -diff --git a/profiles/throughput-performance/tuned.conf b/profiles/throughput-performance/tuned.conf -index dae02dc..42473a9 100644 ---- a/profiles/throughput-performance/tuned.conf -+++ b/profiles/throughput-performance/tuned.conf -@@ -11,7 +11,7 @@ min_perf_pct=100 - transparent_hugepages=always - - [disk] --readahead=4096 -+readahead=>4096 - - [sysctl] - # ktune sysctl settings for rhel6 servers, maximizing i/o throughput -diff --git a/tuned/plugins/base.py b/tuned/plugins/base.py -index bad487f..f0faf38 100644 ---- a/tuned/plugins/base.py -+++ b/tuned/plugins/base.py -@@ -212,7 +212,7 @@ class Plugin(object): - - def _instance_apply_dynamic(self, instance, device): - for option in filter(lambda opt: self._storage_get(instance, self._commands[opt], device) is None, self._options_used_by_dynamic): -- self._save_current_value(instance, self._commands[option], device) -+ self._check_and_save_value(instance, self._commands[option], device) - - self._instance_update_dynamic(instance, device) - -@@ -317,27 +317,50 @@ class Plugin(object): - for device in devices: - self._execute_device_command(instance, command, device, new_value) - -- def _save_current_value(self, instance, command, device = None): -+ def _check_and_save_value(self, instance, command, device = None, new_value = None): - if device is not None: - current_value = command["get"](device) - else: - current_value = command["get"]() -+ if new_value is not None: -+ nws = str(new_value) -+ op = nws[:1] -+ val = nws[1:] -+ try: -+ if op == ">": -+ if int(val) > int(current_value): -+ new_value = val; -+ else: -+ current_value = None -+ new_value = None -+ elif op == "<": -+ if int(val) < int(current_value): -+ new_value = val; -+ else: -+ current_value = None -+ new_value = None -+ except ValueError: -+ log.warn("cannot compare new value '%s' with current value '%s' by operator '%s', using '%s' directly as new value" % (val, current_value, op, new_value)) -+ - if current_value is not None: - self._storage_set(instance, command, current_value, device) -+ return new_value - - def _execute_device_command(self, instance, command, device, new_value): - if command["custom"] is not None: - command["custom"](True, new_value, device) - else: -- self._save_current_value(instance, command, device) -- command["set"](new_value, device) -+ new_value = self._check_and_save_value(instance, command, device, new_value) -+ if new_value is not None: -+ command["set"](new_value, device) - - def _execute_non_device_command(self, instance, command, new_value): - if command["custom"] is not None: - command["custom"](True, new_value) - else: -- self._save_current_value(instance, command) -- command["set"](new_value) -+ new_value = self._check_and_save_value(instance, command, None, new_value) -+ if new_value is not None: -+ command["set"](new_value) - - def _cleanup_all_non_device_commands(self, instance): - for command in filter(lambda command: not command["per_device"], self._commands.values()): --- -cgit v0.10.1 - diff --git a/SOURCES/tuned-2.3.0-cpupower-conflict.patch b/SOURCES/tuned-2.3.0-cpupower-conflict.patch deleted file mode 100644 index 44d8c29..0000000 --- a/SOURCES/tuned-2.3.0-cpupower-conflict.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 284041dc14f21cd343fed4297cd67ff540d22511 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= -Date: Thu, 6 Mar 2014 17:22:09 +0100 -Subject: [PATCH] systemd: added cpupower.service conflict -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Resolves: rhbz#1073392 - -Signed-off-by: Jaroslav Škarvada ---- - tuned.service | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/tuned.service b/tuned.service -index e205730..d2d5d83 100644 ---- a/tuned.service -+++ b/tuned.service -@@ -1,6 +1,7 @@ - [Unit] - Description=Dynamic System Tuning Daemon - After=syslog.target -+Conflicts=cpupower.service - - [Service] - Type=dbus --- -1.8.5.3 - diff --git a/SOURCES/tuned-2.3.0-dirty-ratios.patch b/SOURCES/tuned-2.3.0-dirty-ratios.patch deleted file mode 100644 index da35d92..0000000 --- a/SOURCES/tuned-2.3.0-dirty-ratios.patch +++ /dev/null @@ -1,37 +0,0 @@ -From d5aea87c0bad95d5aa51a2ab3ff5d4e741cd856b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= -Date: Tue, 7 Jan 2014 15:38:26 +0100 -Subject: [PATCH] throughput-performance: altered dirty ratios for better - performance -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Resolves: rhbz#1043533 - -Signed-off-by: Jaroslav Škarvada ---- - profiles/throughput-performance/tuned.conf | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/profiles/throughput-performance/tuned.conf b/profiles/throughput-performance/tuned.conf -index e6a0551..dae02dc 100644 ---- a/profiles/throughput-performance/tuned.conf -+++ b/profiles/throughput-performance/tuned.conf -@@ -35,11 +35,11 @@ kernel.sched_wakeup_granularity_ns = 15000000 - # - # The generator of dirty data starts writeback at this percentage (system default - # is 20%) --vm.dirty_ratio = 10 -+vm.dirty_ratio = 40 - - # Start background writeback (via writeback threads) at this percentage (system - # default is 10%) --vm.dirty_background_ratio = 3 -+vm.dirty_background_ratio = 10 - - # PID allocation wrap value. When the kernel's next PID value - # reaches this value, it wraps back to a minimum PID value. --- -1.8.4.2 - diff --git a/SOURCES/tuned-2.3.0-fix-race.patch b/SOURCES/tuned-2.3.0-fix-race.patch deleted file mode 100644 index 6427fce..0000000 --- a/SOURCES/tuned-2.3.0-fix-race.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/tuned/daemon/daemon.py b/tuned/daemon/daemon.py -index 9741cac..804ac0b 100644 ---- a/tuned/daemon/daemon.py -+++ b/tuned/daemon/daemon.py -@@ -65,7 +65,6 @@ class Daemon(object): - self._save_active_profile(self._profile.name) - self._unit_manager.start_tuning() - -- self._terminate.clear() - while not tuned.utils.commands.wait(self._terminate, self._update_interval): - log.debug("updating monitors") - self._unit_manager.update_monitors() -@@ -105,6 +104,7 @@ class Daemon(object): - - log.info("starting tuning") - self._thread = threading.Thread(target=self._thread_code) -+ self._terminate.clear() - self._thread.start() - return True - diff --git a/SOURCES/tuned-2.3.0-handle-root-block-devices.patch b/SOURCES/tuned-2.3.0-handle-root-block-devices.patch deleted file mode 100644 index 08a7b15..0000000 --- a/SOURCES/tuned-2.3.0-handle-root-block-devices.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/tuned/plugins/plugin_disk.py b/tuned/plugins/plugin_disk.py -index e799895..6101621 100644 ---- a/tuned/plugins/plugin_disk.py -+++ b/tuned/plugins/plugin_disk.py -@@ -31,10 +31,10 @@ class DiskPlugin(hotplug.Plugin): - self._free_devices = self._devices.copy() - - def _device_is_supported(cls, device): -- return device.device_type == "disk" \ -- and device.attributes.get("removable", None) == "0" \ -- and device.parent is not None \ -- and device.parent.subsystem in ["scsi", "virtio"] -+ return device.device_type == "disk" and \ -+ device.attributes.get("removable", None) == "0" and \ -+ (device.parent is None or \ -+ device.parent.subsystem in ["scsi", "virtio"]) - - def _hardware_events_init(self): - self._hardware_inventory.subscribe(self, "block", self._hardware_events_callback) diff --git a/SOURCES/tuned-2.3.0-latency-performance-thp.patch b/SOURCES/tuned-2.3.0-latency-performance-thp.patch deleted file mode 100644 index 28ea6d5..0000000 --- a/SOURCES/tuned-2.3.0-latency-performance-thp.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 640e100341fe97c3127598926c126f00c07499f9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= -Date: Fri, 14 Feb 2014 12:41:59 +0100 -Subject: [PATCH 1/4] latency-performance: leaving THP on its default -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Resolves: rhbz#1064510 - -Signed-off-by: Jaroslav Škarvada ---- - profiles/latency-performance/tuned.conf | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/profiles/latency-performance/tuned.conf b/profiles/latency-performance/tuned.conf -index 929a556..04abfbe 100644 ---- a/profiles/latency-performance/tuned.conf -+++ b/profiles/latency-performance/tuned.conf -@@ -8,9 +8,6 @@ governor=performance - energy_perf_bias=performance - min_perf_pct=100 - --[vm] --transparent_hugepages=never -- - [sysctl] - # ktune sysctl settings for rhel6 servers, maximizing i/o throughput - # --- -1.8.5.3 - diff --git a/SOURCES/tuned-2.3.0-network-latency.patch b/SOURCES/tuned-2.3.0-network-latency.patch deleted file mode 100644 index c603b59..0000000 --- a/SOURCES/tuned-2.3.0-network-latency.patch +++ /dev/null @@ -1,58 +0,0 @@ -From a195fc06fe56ffcbeb2a9ad1a16af7fc38e0ffd5 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= -Date: Fri, 14 Feb 2014 13:13:14 +0100 -Subject: [PATCH 3/4] network-latency: added new profile -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Resolves: rhbz#1052418 - -Signed-off-by: Jaroslav Škarvada ---- - man/tuned-adm.8 | 6 ++++++ - profiles/network-latency/tuned.conf | 15 +++++++++++++++ - 2 files changed, 21 insertions(+) - create mode 100644 profiles/network-latency/tuned.conf - -diff --git a/man/tuned-adm.8 b/man/tuned-adm.8 -index 443fefe..dfba025 100644 ---- a/man/tuned-adm.8 -+++ b/man/tuned-adm.8 -@@ -111,6 +111,12 @@ CPU governor is set to performance andlocked to the low C states (by PM QoS). - CPU energy performance bias to performance. - - .TP -+.BI network-latency -+Profile for low latency network tuning. It is based on the latency-performance -+profile. It additionaly disables transparent hugepages, NUMA balancing and -+tunes several other network related sysctl parameters. -+ -+.TP - .BI "desktop" - Profile optimized for desktops based on balanced profile. It additionaly - enables scheduler autogroups for better response of interactive applications. -diff --git a/profiles/network-latency/tuned.conf b/profiles/network-latency/tuned.conf -new file mode 100644 -index 0000000..f4ec2de ---- /dev/null -+++ b/profiles/network-latency/tuned.conf -@@ -0,0 +1,15 @@ -+# -+# tuned configuration -+# -+ -+[main] -+include=latency-performance -+ -+[vm] -+transparent_hugepages=never -+ -+[sysctl] -+net.core.busy_read=50 -+net.core.busy_poll=50 -+net.ipv4.tcp_fastopen=3 -+kernel.numa_balancing=0 --- -1.8.5.3 - diff --git a/SOURCES/tuned-2.3.0-network-throughput.patch b/SOURCES/tuned-2.3.0-network-throughput.patch deleted file mode 100644 index 52fe31e..0000000 --- a/SOURCES/tuned-2.3.0-network-throughput.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 153afc6c9f7663ad083fbb764164e57737f7e4d2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= -Date: Fri, 14 Feb 2014 13:31:21 +0100 -Subject: [PATCH 4/4] network-throughput: added new profile -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Resolves: rhbz#1052421 - -Signed-off-by: Jaroslav Škarvada ---- - man/tuned-adm.8 | 5 +++++ - profiles/network-throughput/tuned.conf | 15 +++++++++++++++ - 2 files changed, 20 insertions(+) - create mode 100644 profiles/network-throughput/tuned.conf - -diff --git a/man/tuned-adm.8 b/man/tuned-adm.8 -index dfba025..c2a11a3 100644 ---- a/man/tuned-adm.8 -+++ b/man/tuned-adm.8 -@@ -111,6 +111,11 @@ CPU governor is set to performance andlocked to the low C states (by PM QoS). - CPU energy performance bias to performance. - - .TP -+.BI network-throughput -+Profile for throughput network tuning. It is based on the throughput-performance -+profile. It additionaly increases kernel network buffers. -+ -+.TP - .BI network-latency - Profile for low latency network tuning. It is based on the latency-performance - profile. It additionaly disables transparent hugepages, NUMA balancing and -diff --git a/profiles/network-throughput/tuned.conf b/profiles/network-throughput/tuned.conf -new file mode 100644 -index 0000000..fbc2b72 ---- /dev/null -+++ b/profiles/network-throughput/tuned.conf -@@ -0,0 +1,15 @@ -+# -+# tuned configuration -+# -+ -+[main] -+include=throughput-performance -+ -+[sysctl] -+# Increase kernel buffer size maximums. Currently this seems only necessary at 40Gb speeds. -+# -+# The buffer tuning values below do not account for any potential hugepage allocation. -+# Ensure that you do not oversubscribe system memory. -+net.ipv4.tcp_rmem="4096 87380 16777216" -+net.ipv4.tcp_wmem="4096 16384 16777216" -+net.ipv4.udp_mem="3145728 4194304 16777216" --- -1.8.5.3 - diff --git a/SOURCES/tuned-2.3.0-no-find.patch b/SOURCES/tuned-2.3.0-no-find.patch deleted file mode 100644 index 0dd80e4..0000000 --- a/SOURCES/tuned-2.3.0-no-find.patch +++ /dev/null @@ -1,20 +0,0 @@ -commit a47b0e1be74f31d15279aac8ae5b1438932844a2 -Author: Jaroslav Škarvada -Date: Tue Nov 12 14:57:01 2013 +0100 - - spindown-disk: removed useless find, probably typo - - Signed-off-by: Jaroslav Škarvada - -diff --git a/profiles/spindown-disk/script.sh b/profiles/spindown-disk/script.sh -index fa2d389..5ee40dd 100755 ---- a/profiles/spindown-disk/script.sh -+++ b/profiles/spindown-disk/script.sh -@@ -12,7 +12,6 @@ start() { - disable_logs_syncing - - remount_partitions commit=600,noatime $EXT_PARTITIONS -- find /etc/ &> /dev/null - sync - - return 0 diff --git a/SOURCES/tuned-2.3.0-throughput-performance-on-server.patch b/SOURCES/tuned-2.3.0-throughput-performance-on-server.patch deleted file mode 100644 index 37337d7..0000000 --- a/SOURCES/tuned-2.3.0-throughput-performance-on-server.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/recommend.conf b/recommend.conf -index 7a45523..d01ebdf 100644 ---- a/recommend.conf -+++ b/recommend.conf -@@ -9,7 +9,7 @@ - - [throughput-performance] - virt= --system=.*computenode.* -+system=.*(computenode|server).* - - [virtual-guest] - virt=.+ diff --git a/SOURCES/tuned-2.3.0-timing-improvements.patch b/SOURCES/tuned-2.3.0-timing-improvements.patch deleted file mode 100644 index 7d9bd97..0000000 --- a/SOURCES/tuned-2.3.0-timing-improvements.patch +++ /dev/null @@ -1,139 +0,0 @@ -diff --git a/man/tuned-main.conf.5 b/man/tuned-main.conf.5 -index 61a6a4b..6f324be 100644 ---- a/man/tuned-main.conf.5 -+++ b/man/tuned-main.conf.5 -@@ -16,17 +16,31 @@ will be used. Please note if it is enabled here, it is still possible - to individually disable it in plugins. - - .TP -+.BI sleep_interval= INT -+Tuned daemon is periodically waken after \fIINT\fR seconds and checks -+for events. By default this is set to 1 second. If you have Python 2 -+interpreter with applied patch from Red Hat Bugzilla #917709 this -+controls responsiveness time of Tuned to commands (i.e. if you -+request profile switch, it may take up to 1 second until Tuned reacts). -+Increase this number for higher responsiveness times and more power -+savings (due to lower number of wakeups). In case you have unpatched -+Python 2 interpreter, this settings will have no visible effect, -+because the intepreter will poll 20 times per second. -+ -+.TP - .BI update_interval= INT - Update interval for dynamic tuning (in seconds). Tuned daemon is periodically - waken after \fIINT\fR seconds, updates its monitors, calculates new tuning - parameters for enabled plugins and applies the changes. Plugins that have - disabled dynamic tuning are not processed. By default the \fIINT\fR is set - to 10 seconds. Tuned daemon doesn't periodically wake if dynamic tuning is --globally disabled (see \fBdynamic_tuning\fR). -+globally disabled (see \fBdynamic_tuning\fR) or this setting set to 0. -+This must be multiple of \fBsleep_interval\fR. - - .SH EXAMPLE - .nf - dynamic_tuning = 1 -+sleep_interval = 1 - update_interval = 10 - .fi - -diff --git a/tuned/consts.py b/tuned/consts.py -index 1dd53ab..6c8dc4b 100644 ---- a/tuned/consts.py -+++ b/tuned/consts.py -@@ -18,5 +18,7 @@ SYSTEM_RELEASE_FILE = "/etc/system-release-cpe" - - # default configuration - CFG_DEF_DYNAMIC_TUNING = True -+# how long to sleep before checking for events (in seconds) -+CFG_DEF_SLEEP_INTERVAL = 1 - # update interval for dynamic tuning (in seconds) - CFG_DEF_UPDATE_INTERVAL = 10 -diff --git a/tuned/daemon/application.py b/tuned/daemon/application.py -index f1b5208..e4c9da3 100644 ---- a/tuned/daemon/application.py -+++ b/tuned/daemon/application.py -@@ -16,6 +16,7 @@ log = tuned.logs.get() - __all__ = ["Application"] - - global_config_spec = ["dynamic_tuning = boolean(default=%s)" % consts.CFG_DEF_DYNAMIC_TUNING, -+ "sleep_interval = integer(default=%s)" % consts.CFG_DEF_SLEEP_INTERVAL, - "update_interval = integer(default=%s)" % consts.CFG_DEF_UPDATE_INTERVAL] - - class Application(object): -@@ -31,7 +32,6 @@ class Application(object): - self.config = self._load_global_config() - if self.config.get("dynamic_tuning"): - log.info("dynamic tuning is enabled (can be overriden in plugins)") -- log.info("update interval is %d seconds" % self.config.get("update_interval")) - else: - log.info("dynamic tuning is globally disabled") - -@@ -44,7 +44,7 @@ class Application(object): - profile_loader = profiles.Loader(profile_locator, profile_factory, profile_merger) - - -- self._daemon = daemon.Daemon(unit_manager, profile_loader, profile_name, int(self.config.get("update_interval", consts.CFG_DEF_UPDATE_INTERVAL))) -+ self._daemon = daemon.Daemon(unit_manager, profile_loader, profile_name, self.config) - self._controller = controller.Controller(self._daemon) - - self._dbus_exporter = None -diff --git a/tuned/daemon/daemon.py b/tuned/daemon/daemon.py -index 804ac0b..35f60c2 100644 ---- a/tuned/daemon/daemon.py -+++ b/tuned/daemon/daemon.py -@@ -9,9 +9,27 @@ log = tuned.logs.get() - - - class Daemon(object): -- def __init__(self, unit_manager, profile_loader, profile_name=None, update_interval = int(consts.CFG_DEF_UPDATE_INTERVAL)): -+ def __init__(self, unit_manager, profile_loader, profile_name=None, config=None): - log.debug("initializing daemon") -- self._update_interval = update_interval -+ self._sleep_interval = int(consts.CFG_DEF_SLEEP_INTERVAL) -+ self._update_interval = int(consts.CFG_DEF_UPDATE_INTERVAL) -+ self._dynamic_tuning = consts.CFG_DEF_DYNAMIC_TUNING -+ if config is not None: -+ self._sleep_interval = int(config.get("sleep_interval", consts.CFG_DEF_SLEEP_INTERVAL)) -+ self._update_interval = int(config.get("update_interval", consts.CFG_DEF_UPDATE_INTERVAL)) -+ self._dynamic_tuning = config.get("dynamic_tuning", consts.CFG_DEF_DYNAMIC_TUNING) -+ if self._sleep_interval <= 0: -+ self._sleep_interval = int(consts.CFG_DEF_SLEEP_INTERVAL) -+ if self._update_interval == 0: -+ self._dynamic_tuning = False -+ elif self._update_interval < self._sleep_interval: -+ self._update_interval = self._sleep_interval -+ self._sleep_cycles = self._update_interval // self._sleep_interval -+ log.info("using sleep interval of %d second(s)" % self._sleep_interval) -+ if self._dynamic_tuning: -+ log.info("dynamic tuning is enabled (can be overriden by plugins)") -+ log.info("using update interval of %d second(s) (%d times of the sleep interval)" % (self._sleep_cycles * self._sleep_interval, self._sleep_cycles)) -+ - self._unit_manager = unit_manager - self._profile_loader = profile_loader - self._init_threads() -@@ -65,11 +83,21 @@ class Daemon(object): - self._save_active_profile(self._profile.name) - self._unit_manager.start_tuning() - -- while not tuned.utils.commands.wait(self._terminate, self._update_interval): -- log.debug("updating monitors") -- self._unit_manager.update_monitors() -- log.debug("performing tunings") -- self._unit_manager.update_tuning() -+ # In python 2 interpreter with applied patch for rhbz#917709 we need to periodically -+ # poll, otherwise the python will not have chance to update events / locks (due to GIL) -+ # and e.g. DBus control will not work. The polling interval of 1 seconds (which is -+ # the default) is still much better than 50 ms polling with unpatched interpreter. -+ # For more details see tuned rhbz#917587. -+ _sleep_cnt = self._sleep_cycles -+ while not tuned.utils.commands.wait(self._terminate, self._sleep_interval): -+ if self._dynamic_tuning: -+ _sleep_cnt -= 1 -+ if _sleep_cnt <= 0: -+ _sleep_cnt = self._sleep_cycles -+ log.debug("updating monitors") -+ self._unit_manager.update_monitors() -+ log.debug("performing tunings") -+ self._unit_manager.update_tuning() - - self._unit_manager.stop_tuning() - self._unit_manager.destroy_all() diff --git a/SOURCES/tuned-2.4.0-gtk-3.8.patch b/SOURCES/tuned-2.4.0-gtk-3.8.patch new file mode 100644 index 0000000..fc73fd8 --- /dev/null +++ b/SOURCES/tuned-2.4.0-gtk-3.8.patch @@ -0,0 +1,100 @@ +diff --git a/tuned-gui.glade b/tuned-gui.glade +index 36e173a..30dd51a 100644 +--- a/tuned-gui.glade ++++ b/tuned-gui.glade +@@ -1,7 +1,6 @@ + + + +- + + False + dialog +@@ -729,12 +728,6 @@ + + True + False +- +- +- True +- False +- +- + + + False +diff --git a/tuned-gui.py b/tuned-gui.py +index 1483f4e..5fd25b5 100755 +--- a/tuned-gui.py ++++ b/tuned-gui.py +@@ -299,8 +299,6 @@ class Base(object): + + self.label_actual_profile.set_text(self.controller.active_profile()) + self.label_recommended_profile.set_text(self.controller.recommend_profile()) +- self.listbox_summary_of_active_profile = \ +- self.builder.get_object('listboxSummaryOfActiveProfile') + + self.data_for_listbox_summary_of_active_profile() + self.comboboxtext_fast_change_profile.set_model(self.treestore_profiles) +@@ -425,9 +423,6 @@ class Base(object): + This method is emited after change profile and on startup of app. + """ + +- for row in self.listbox_summary_of_active_profile: +- self.listbox_summary_of_active_profile.remove(row) +- + if self.is_tuned_connection_ok(): + self.active_profile = \ + self.manager.get_profile(self.controller.active_profile()) +@@ -443,51 +438,6 @@ class Base(object): + + self.label_summary_included_profile.set_text('None') + +- row = Gtk.ListBoxRow() +- box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=0) +- plugin_name = Gtk.Label() +- plugin_name.set_markup('Plugin Name') +- plugin_option = Gtk.Label() +- plugin_option.set_markup('Plugin Options') +- box.pack_start(plugin_name, True, True, 0) +- box.pack_start(plugin_option, True, True, 0) +- row.add(box) +- +- self.listbox_summary_of_active_profile.add(row) +- +- sep = Gtk.Separator.new(Gtk.Orientation.HORIZONTAL) +- self.listbox_summary_of_active_profile.add(sep) +- sep.show() +- +- for u in self.active_profile.units: +- row = Gtk.ListBoxRow() +- hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, +- spacing=0) +- hbox.set_homogeneous(True) +- row.add(hbox) +- label = Gtk.Label() +- label.set_markup(u) +- label.set_justify(Gtk.Justification.LEFT) +- hbox.pack_start(label, False, True, 1) +- +- grid = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, +- spacing=0) +- grid.set_homogeneous(True) +- for o in self.active_profile.units[u].options: +- label_option = Gtk.Label() +- label_option.set_markup(o + ' = ' + '' +- + self.active_profile.units[u].options[o] +- + '') +- grid.pack_start(label_option, False, True, 0) +- +- hbox.pack_start(grid, False, True, 0) +- self.listbox_summary_of_active_profile.add(row) +- separator = Gtk.Separator.new(Gtk.Orientation.HORIZONTAL) +- self.listbox_summary_of_active_profile.add(separator) +- separator.show() +- +- self.listbox_summary_of_active_profile.show_all() +- + # def on_treeview_button_press_event(self, treeview, event): + # popup = Gtk.Menu() + # popup.append(Gtk.MenuItem('add')) diff --git a/SPECS/tuned.spec b/SPECS/tuned.spec index 45b3936..1000ef8 100644 --- a/SPECS/tuned.spec +++ b/SPECS/tuned.spec @@ -1,7 +1,7 @@ Summary: A dynamic adaptive system tuning daemon Name: tuned -Version: 2.3.0 -Release: 11%{?dist}.3 +Version: 2.4.1 +Release: 1%{?dist} License: GPLv2+ Source: https://fedorahosted.org/releases/t/u/tuned/tuned-%{version}.tar.bz2 URL: https://fedorahosted.org/tuned/ @@ -11,18 +11,10 @@ Requires(post): systemd, virt-what Requires(preun): systemd Requires(postun): systemd Requires: python-decorator, dbus-python, pygobject3-base, python-pyudev +# kernel-tools, hdparm dependencies are not met on s390 Requires: virt-what, python-configobj, ethtool, gawk -Patch0: tuned-2.3.0-fix-race.patch -Patch1: tuned-2.3.0-timing-improvements.patch -Patch2: tuned-2.3.0-no-find.patch -Patch3: tuned-2.3.0-dirty-ratios.patch -Patch4: tuned-2.3.0-throughput-performance-on-server.patch -Patch5: tuned-2.3.0-latency-performance-thp.patch -Patch6: tuned-2.3.0-network-latency.patch -Patch7: tuned-2.3.0-network-throughput.patch -Patch8: tuned-2.3.0-cpupower-conflict.patch -Patch9: tuned-2.3.0-handle-root-block-devices.patch -Patch10: tuned-2.3.0-assignment-modifiers.patch +Requires: util-linux +Patch0: tuned-2.4.0-gtk-3.8.patch %description The tuned package contains a daemon that tunes system settings dynamically. @@ -31,10 +23,18 @@ Based on that information components will then be put into lower or higher power saving modes to adapt to the current usage. Currently only ethernet network and ATA harddisk devices are implemented. +%package gtk +Summary: GTK GUI for tuned +Requires: %{name} = %{version}-%{release} +Requires: powertop, pygobject3-base, polkit + +%description gtk +GTK GUI that can control tuned and provide simple profile editor. + %package utils Requires: %{name} = %{version}-%{release} -Summary: Various tuned utilities Requires: powertop +Summary: Various tuned utilities %description utils This package contains utilities that can help you to fine tune and @@ -52,6 +52,27 @@ minimal, maximal and average time between operations to be able to identify applications that behave power inefficient (many small operations instead of fewer large ones). +%package profiles-sap +Summary: Additional tuned profile(s) targeted to SAP NetWeaver loads +Requires: %{name} = %{version}-%{release} + +%description profiles-sap +Additional tuned profile(s) targeted to SAP NetWeaver loads. + +%package profiles-sap-hana +Summary: Additional tuned profile(s) targeted to SAP HANA loads +Requires: %{name} = %{version}-%{release} + +%description profiles-sap-hana +Additional tuned profile(s) targeted to SAP HANA loads. + +%package profiles-atomic +Summary: Additional tuned profiles targeted to Atomic +Requires: %{name} = %{version}-%{release} + +%description profiles-atomic +Additional tuned profiles targeted to Atomic host and guest. + %package profiles-compat Summary: Additional tuned profiles mainly for backward compatibility with tuned 1.0 Requires: %{name} = %{version}-%{release} @@ -63,39 +84,26 @@ It can be also used to fine tune your system for specific scenarios. %prep %setup -q %patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 -%patch9 -p1 -%patch10 -p1 %build %install -make install DESTDIR=%{buildroot} +make install DESTDIR=%{buildroot} DOCDIR=%{_docdir}/%{name}-%{version} %if 0%{?rhel} sed -i 's/\(dynamic_tuning[ \t]*=[ \t]*\).*/\10/' %{buildroot}%{_sysconfdir}/tuned/tuned-main.conf %endif +# conditional support for grub2, grub2 is not available on all architectures +# and tuned is noarch package, thus the following hack is needed +mkdir -p %{buildroot}%{_datadir}/tuned/grub2 +mv %{buildroot}%{_sysconfdir}/grub.d/00_tuned %{buildroot}%{_datadir}/tuned/grub2/00_tuned +rmdir %{buildroot}%{_sysconfdir}/grub.d %post %systemd_post tuned.service -# try to autodetect the best profile for the system in case there is none preset -if [ ! -f /etc/tuned/active_profile -o -z "`cat /etc/tuned/active_profile 2>/dev/null`" ] -then - PROFILE=`/usr/sbin/tuned-adm recommend 2>/dev/null` - [ "$PROFILE" ] || PROFILE=balanced - /usr/sbin/tuned-adm profile "$PROFILE" 2>/dev/null || echo -n "$PROFILE" > /etc/tuned/active_profile -fi - # convert active_profile from full path to name (if needed) sed -i 's|.*/\([^/]\+\)/[^\.]\+\.conf|\1|' /etc/tuned/active_profile @@ -107,6 +115,12 @@ sed -i 's|.*/\([^/]\+\)/[^\.]\+\.conf|\1|' /etc/tuned/active_profile %postun %systemd_postun_with_restart tuned.service +# conditional support for grub2, grub2 is not available on all architectures +# and tuned is noarch package, thus the following hack is needed +if [ "$1" == 0 ]; then + rm -f %{_sysconfdir}/grub.d/00_tuned || : +fi + %triggerun -- tuned < 2.0-0 # remove ktune from old tuned, now part of tuned @@ -114,13 +128,22 @@ sed -i 's|.*/\([^/]\+\)/[^\.]\+\.conf|\1|' /etc/tuned/active_profile /usr/sbin/chkconfig --del ktune &>/dev/null || : +%posttrans +# conditional support for grub2, grub2 is not available on all architectures +# and tuned is noarch package, thus the following hack is needed +if [ -d %{_sysconfdir}/grub.d ]; then + cp -a %{_datadir}/tuned/grub2/00_tuned %{_sysconfdir}/grub.d/00_tuned +fi + + %files %defattr(-,root,root,-) %doc AUTHORS %doc COPYING %doc README %doc doc/TIPS.txt -%{_sysconfdir}/bash_completion.d +%{_datadir}/bash-completion/completions/tuned +%exclude %{python_sitelib}/tuned/gtk %{python_sitelib}/tuned %{_sbindir}/tuned %{_sbindir}/tuned-adm @@ -131,20 +154,35 @@ sed -i 's|.*/\([^/]\+\)/[^\.]\+\.conf|\1|' /etc/tuned/active_profile %exclude %{_prefix}/lib/tuned/laptop-battery-powersave %exclude %{_prefix}/lib/tuned/enterprise-storage %exclude %{_prefix}/lib/tuned/spindown-disk +%exclude %{_prefix}/lib/tuned/sap-netweaver +%exclude %{_prefix}/lib/tuned/sap-hana +%exclude %{_prefix}/lib/tuned/sap-hana-vmware +%exclude %{_prefix}/lib/tuned/atomic-host +%exclude %{_prefix}/lib/tuned/atomic-guest %{_prefix}/lib/tuned %dir %{_sysconfdir}/tuned -%config(noreplace) %{_sysconfdir}/tuned/active_profile +%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/tuned/active_profile %config(noreplace) %{_sysconfdir}/tuned/tuned-main.conf -%{_sysconfdir}/tmpfiles.d +%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/tuned/bootcmdline %{_sysconfdir}/dbus-1/system.d/com.redhat.tuned.conf +%{_tmpfilesdir}/tuned.conf %{_unitdir}/tuned.service %dir %{_localstatedir}/log/tuned %dir /run/tuned %{_mandir}/man5/tuned* +%{_mandir}/man7/tuned-profiles.7* %{_mandir}/man8/tuned* +%dir %{_datadir}/tuned +%{_datadir}/tuned/grub2 -%files utils +%files gtk %defattr(-,root,root,-) +%{_sbindir}/tuned-gui +%{python_sitelib}/tuned/gtk +%{_datadir}/tuned/ui +%{_datadir}/polkit-1/actions/org.tuned.gui.policy + +%files utils %doc COPYING %{_bindir}/powertop2tuned %{_libexecdir}/tuned/pmqos-static* @@ -163,6 +201,23 @@ sed -i 's|.*/\([^/]\+\)/[^\.]\+\.conf|\1|' /etc/tuned/active_profile %{_mandir}/man8/diskdevstat.* %{_mandir}/man8/scomes.* +%files profiles-sap +%defattr(-,root,root,-) +%{_prefix}/lib/tuned/sap-netweaver +%{_mandir}/man7/tuned-profiles-sap.7* + +%files profiles-sap-hana +%defattr(-,root,root,-) +%{_prefix}/lib/tuned/sap-hana +%{_prefix}/lib/tuned/sap-hana-vmware +%{_mandir}/man7/tuned-profiles-sap-hana.7* + +%files profiles-atomic +%defattr(-,root,root,-) +%{_prefix}/lib/tuned/atomic-host +%{_prefix}/lib/tuned/atomic-guest +%{_mandir}/man7/tuned-profiles-atomic.7* + %files profiles-compat %defattr(-,root,root,-) %{_prefix}/lib/tuned/default @@ -172,19 +227,81 @@ sed -i 's|.*/\([^/]\+\)/[^\.]\+\.conf|\1|' /etc/tuned/active_profile %{_prefix}/lib/tuned/laptop-battery-powersave %{_prefix}/lib/tuned/enterprise-storage %{_prefix}/lib/tuned/spindown-disk +%{_mandir}/man7/tuned-profiles-compat.7* %changelog -* Thu May 22 2014 Jaroslav Škarvada - 2.3.0-11.3 -- rebuilt due to bad dist macro - resolves: rhbz#1092926 +* Thu Oct 16 2014 Jaroslav Škarvada - 2.4.1-1 +- new-release + resolves: rhbz#1093883 + +* Tue Oct 7 2014 Jaroslav Škarvada - 2.4.0-6 +- add autodetection of grub2 to plugin_bootloader + resolves: rhbz#1150047 + +* Mon Oct 6 2014 Jaroslav Škarvada - 2.4.0-5 +- fixed tuned-adm list traceback + resolves: rhbz#1149162 -* Mon May 12 2014 Jaroslav Škarvada - 2.3.0-11.2 +* Mon Oct 6 2014 Jaroslav Škarvada - 2.4.0-4 +- fixed cmdline handling in bootloader plugin + related: rhbz#1148711 + +* Mon Oct 6 2014 Jaroslav Škarvada - 2.4.0-3 +- grub template 00_tuned, do not return error if there is no cmdline + resolves: rhbz#1148711 + +* Wed Oct 1 2014 Jaroslav Škarvada - 2.4.0-2 +- fixed tuned-gui polkit path + related: rhbz#1093883 + +* Wed Oct 1 2014 Jaroslav Škarvada - 2.4.0-1 +- new-release + resolves: rhbz#1093883 + - fixed traceback if profile cannot be loaded + related: rhbz#953128 + - powertop2tuned: fixed traceback if rewriting file instead of dir + - daemon: fixed race condition in start/stop + - balanced: used medium_power ALPM policy + - balanced: used conservative CPU governor + resolves: rhbz#1124125 + - plugins: added selinux plugin + - plugin_net: added nf_conntrack_hashsize parameter + - profiles: included sap-hana and sap-hana-vmware profiles + - profiles: sap-profiles in individual subpackages + resolves: rhbz#1058483 + - man: structured profiles manual pages according to sub-packages + - improved error handling of switch_profile + - tuned-adm: active: detect whether tuned deamon is running + - removed active_profile from RPM verification + resolves: rhbz#1104126 + - plugin_disk: readahead value can be now specified in sectors + resolves: rhbz#1127127 + - plugins: added bootloader plugin + resolves: rhbz#1044111 + - plugin_disk: added error counter to hdparm calls + - plugins: added scheduler plugin + resolves: rhbz#1100826 + - added tuned-gui + +* Fri Sep 19 2014 Jaroslav Škarvada - 2.3.0-16 +- autodetecting initial profile in runtime, not int post install + resolves: rhbz#1144067 + +* Tue Sep 2 2014 Jaroslav Škarvada - 2.3.0-15 +- updated man page to include atomic-host and atomic-guest profiles + related: rhbz#1091977, rhbz#1091979 + +* Wed Aug 27 2014 Jaroslav Škarvada - 2.3.0-14 +- add atomic-host and atomic-guest profiles + resolves: rhbz#1091977, rhbz#1091979 + +* Mon May 12 2014 Jaroslav Škarvada - 2.3.0-13 - add support for assignment modifiers - resolves: rhbz#1096960 + resolves: rhbz#1096917 -* Wed May 7 2014 Jaroslav Škarvada - 2.3.0-11.1 +* Wed May 7 2014 Jaroslav Škarvada - 2.3.0-12 - handle root block devices - resolves: rhbz#1096132 + resolves: rhbz#1033251 * Fri Mar 7 2014 Jaroslav Škarvada - 2.3.0-11 - reverted fix for bug 1073008, dependency is not met on s390