From 990480d0dc33e53a4c5a6bc7ee1585307dff2b4a Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jan 25 2018 09:28:32 +0000 Subject: import tuned-2.8.0-5.el7_4.2 --- diff --git a/SOURCES/tuned-2.8.0-change-force-latency.patch b/SOURCES/tuned-2.8.0-change-force-latency.patch new file mode 100644 index 0000000..0f3c9ef --- /dev/null +++ b/SOURCES/tuned-2.8.0-change-force-latency.patch @@ -0,0 +1,26 @@ +diff --git a/profiles/sap-hana-vmware/tuned.conf b/profiles/sap-hana-vmware/tuned.conf +index 9378219..99aa137 100644 +--- a/profiles/sap-hana-vmware/tuned.conf ++++ b/profiles/sap-hana-vmware/tuned.conf +@@ -7,7 +7,7 @@ summary=Optimize for SAP running inside a VMware guest + include=throughput-performance + + [cpu] +-force_latency=1 ++force_latency=70 + + [vm] + transparent_hugepages=never +diff --git a/profiles/sap-hana/tuned.conf b/profiles/sap-hana/tuned.conf +index 42f18e0..b11fe17 100644 +--- a/profiles/sap-hana/tuned.conf ++++ b/profiles/sap-hana/tuned.conf +@@ -7,7 +7,7 @@ summary=Optimize for SAP + include=throughput-performance + + [cpu] +-force_latency=1 ++force_latency=70 + + [vm] + transparent_hugepages=never diff --git a/SOURCES/tuned-2.8.0-improve-reboot-check.patch b/SOURCES/tuned-2.8.0-improve-reboot-check.patch new file mode 100644 index 0000000..f22ac63 --- /dev/null +++ b/SOURCES/tuned-2.8.0-improve-reboot-check.patch @@ -0,0 +1,57 @@ +diff --git a/tuned.service b/tuned.service +index fcb3fa0..c59e3a9 100644 +--- a/tuned.service ++++ b/tuned.service +@@ -1,6 +1,6 @@ + [Unit] + Description=Dynamic System Tuning Daemon +-After=syslog.target systemd-sysctl.service network.target ++After=syslog.target systemd-sysctl.service network.target dbus.service + Requires=dbus.service polkit.service + Conflicts=cpupower.service + +diff --git a/tuned/daemon/daemon.py b/tuned/daemon/daemon.py +index b7db721..f78ec5a 100644 +--- a/tuned/daemon/daemon.py ++++ b/tuned/daemon/daemon.py +@@ -6,6 +6,7 @@ from tuned.exceptions import TunedException + from tuned.profiles.exceptions import InvalidProfileException + import tuned.consts as consts + from tuned.utils.commands import commands ++import re + + log = tuned.logs.get() + +@@ -98,6 +99,13 @@ class Daemon(object): + self._application._dbus_exporter.send_signal(consts.DBUS_SIGNAL_PROFILE_CHANGED, profile_name, result, errstr) + return errstr + ++ def _system_shutting_down(self): ++ retcode, out = self._cmd.execute(["systemctl", "is-system-running"], no_errors = [0]) ++ if out[:8] == "stopping": ++ return True ++ retcode, out = self._cmd.execute(["systemctl", "list-jobs"], no_errors = [0]) ++ return re.search(r"\b(shutdown|reboot|halt|poweroff)\.target.*start", out) is not None ++ + def _thread_code(self): + if self._profile is None: + raise TunedException("Cannot start the daemon without setting a profile.") +@@ -143,13 +151,11 @@ class Daemon(object): + # stopped by user and in such case do full cleanup, without systemd never + # do full cleanup + full_rollback = False +- retcode, out = self._cmd.execute(["systemctl", "is-system-running"], no_errors = [0]) +- if retcode >= 0: +- if out[:8] == "stopping": +- log.info("terminating Tuned due to system shutdown / reboot") +- else: +- log.info("terminating Tuned, rolling back all changes") +- full_rollback = True ++ if self._system_shutting_down(): ++ log.info("terminating Tuned due to system shutdown / reboot") ++ else: ++ log.info("terminating Tuned, rolling back all changes") ++ full_rollback = True + if self._daemon: + self._unit_manager.stop_tuning(full_rollback) + self._unit_manager.destroy_all() diff --git a/SOURCES/tuned-2.8.0-increase-dbus-timeout.patch b/SOURCES/tuned-2.8.0-increase-dbus-timeout.patch new file mode 100644 index 0000000..0060988 --- /dev/null +++ b/SOURCES/tuned-2.8.0-increase-dbus-timeout.patch @@ -0,0 +1,49 @@ +From bfab9d8d22adb9a4382a94142782906674c1bf59 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= +Date: Thu, 7 Sep 2017 16:03:59 +0200 +Subject: [PATCH 1/2] tuned-adm: Increase DBus call timeout to 40 seconds +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Increase timeout for DBus method calls in tuned-adm to 40 seconds. +This is meant to prevent simultaneous timeouts in tuned-adm and +the tuned daemon. + +Previously it could happen, that e.g. + tuned-adm profile +was executed, issuing a DBus call to the tuned daemon, +then in response the tuned daemon would issue a DBus +call to Polkit in order to authorize the profile switch request, and +this call would time out. The call to Polkit would time out after the +default DBus timeout of 25 seconds and simultaneously the tuned-adm's +call to tuned daemon would also time out, because the same default +timeout was used. After that, if the fallback authorization method +in tuned daemon succeeded, the daemon would start applying the new +profile, and at the same time tuned-adm would use the fallback method, +which is restarting tuned (systemctl restart tuned). This could +potentially lead to all sorts of race conditions. Let's avoid that +by increasing the timeout in tuned-adm, so that tuned has time +to apply a profile after a failed Polkit call. + +Related: rhbz#1475571 + +Signed-off-by: Ondřej Lysoněk +--- + tuned/admin/dbus_controller.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tuned/admin/dbus_controller.py b/tuned/admin/dbus_controller.py +index fa46a0d..8567e34 100644 +--- a/tuned/admin/dbus_controller.py ++++ b/tuned/admin/dbus_controller.py +@@ -67,7 +67,7 @@ def _call(self, method_name, *args, **kwargs): + + try: + method = self._interface.get_dbus_method(method_name) +- return method(*args, **kwargs) ++ return method(*args, timeout=40) + except dbus.exceptions.DBusException as dbus_exception: + err_str = "DBus call to Tuned daemon failed" + if self._debug: + diff --git a/SPECS/tuned.spec b/SPECS/tuned.spec index db2e543..898757f 100644 --- a/SPECS/tuned.spec +++ b/SPECS/tuned.spec @@ -1,7 +1,7 @@ Summary: A dynamic adaptive system tuning daemon Name: tuned Version: 2.8.0 -Release: 5%{?dist} +Release: 5%{?dist}.2 License: GPLv2+ Source: https://jskarvad.fedorapeople.org/tuned/download/tuned-%{version}.tar.bz2 URL: http://www.tuned-project.org/ @@ -19,6 +19,9 @@ Patch0: tuned-2.8.0-gtk-3.8.patch Patch1: tuned-2.8.0-workaround-for-old-pyudev.patch Patch2: tuned-2.8.0-realtime-skew-tick-and-inheritance.patch Patch3: tuned-2.8.0-realtime-priorities-update.patch +Patch4: tuned-2.8.0-change-force-latency.patch +Patch5: tuned-2.8.0-increase-dbus-timeout.patch +Patch6: tuned-2.8.0-improve-reboot-check.patch %description The tuned package contains a daemon that tunes system settings dynamically. @@ -150,6 +153,9 @@ It can be also used to fine tune your system for specific scenarios. %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 %build @@ -386,6 +392,14 @@ fi %{_mandir}/man7/tuned-profiles-compat.7* %changelog +* Mon Oct 30 2017 Jaroslav Škarvada - 2.8.0-5.2 +- fixed profile application from cloud-init + resolves: rhbz#1507564 + +* Mon Oct 23 2017 Jaroslav Škarvada - 2.8.0-5.1 +- sap-hana: change force_latency to 70 + resolves: rhbz#1505166 + * Mon Jun 12 2017 Jaroslav Škarvada - 2.8.0-5 - realtime: re-assigned kernel thread priorities resolves: rhbz#1452357