From 684be320a295b51aea5275216b20e5c40b904f8e Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jun 10 2014 13:27:13 +0000 Subject: import tuned-2.3.0-11.el7_0.3 --- diff --git a/SOURCES/tuned-2.3.0-assignment-modifiers.patch b/SOURCES/tuned-2.3.0-assignment-modifiers.patch new file mode 100644 index 0000000..62d3262 --- /dev/null +++ b/SOURCES/tuned-2.3.0-assignment-modifiers.patch @@ -0,0 +1,115 @@ +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-handle-root-block-devices.patch b/SOURCES/tuned-2.3.0-handle-root-block-devices.patch new file mode 100644 index 0000000..08a7b15 --- /dev/null +++ b/SOURCES/tuned-2.3.0-handle-root-block-devices.patch @@ -0,0 +1,19 @@ +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/SPECS/tuned.spec b/SPECS/tuned.spec index 6fb8436..45b3936 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} +Release: 11%{?dist}.3 License: GPLv2+ Source: https://fedorahosted.org/releases/t/u/tuned/tuned-%{version}.tar.bz2 URL: https://fedorahosted.org/tuned/ @@ -21,6 +21,8 @@ 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 %description The tuned package contains a daemon that tunes system settings dynamically. @@ -69,6 +71,8 @@ It can be also used to fine tune your system for specific scenarios. %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch9 -p1 +%patch10 -p1 %build @@ -170,6 +174,18 @@ sed -i 's|.*/\([^/]\+\)/[^\.]\+\.conf|\1|' /etc/tuned/active_profile %{_prefix}/lib/tuned/spindown-disk %changelog +* Thu May 22 2014 Jaroslav Škarvada - 2.3.0-11.3 +- rebuilt due to bad dist macro + resolves: rhbz#1092926 + +* Mon May 12 2014 Jaroslav Škarvada - 2.3.0-11.2 +- add support for assignment modifiers + resolves: rhbz#1096960 + +* Wed May 7 2014 Jaroslav Škarvada - 2.3.0-11.1 +- handle root block devices + resolves: rhbz#1096132 + * Fri Mar 7 2014 Jaroslav Škarvada - 2.3.0-11 - reverted fix for bug 1073008, dependency is not met on s390 related: rhbz#1073008