Browse Source

tuned update

Signed-off-by: basebuilder_pel7ppc64lebuilder0 <basebuilder@powerel.org>
master
basebuilder_pel7ppc64lebuilder0 4 years ago
parent
commit
9d51c479e8
  1. 26
      SOURCES/0001-Fix-verifying-sysctl-options-with-tabs.patch
  2. 32
      SOURCES/0001-functions-Return-an-ordered-cpu-list-in-cpulist_onli.patch
  3. 68
      SOURCES/0001-sysctl-Ignore-non-existent-settings-from-system-sysc.patch
  4. 33
      SOURCES/0001-virtual-host-Fix-setting-force_latency.patch
  5. 41
      SOURCES/tuned-2.11.0-realtime-virtual-profiles-enable-ktimer-lockless-check.patch
  6. 14
      SOURCES/tuned-2.11.0-sap-hana-vmware-deprecation.patch
  7. 45
      SOURCES/tuned-2.11.0-sysctl-modifiers-traceback-fix.patch
  8. 115
      SPECS/tuned.spec

26
SOURCES/0001-Fix-verifying-sysctl-options-with-tabs.patch

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
From b6eb3416eac4e8ca21ae7d65ca9a79f18e078af7 Mon Sep 17 00:00:00 2001
From: kbotc <kbotc@mac.com>
Date: Tue, 14 May 2019 16:45:22 -0600
Subject: [PATCH] Fix verifying sysctl options with tabs

sysctl options such as net.ipv4.tcp_wmem and net.ipv4.tcp_rmem include tabs. When you use tuned-adm verify, the changes report back as broken as the whitespaces are different because one side has been sanitized but the other side has not. This pull request will fix that.
---
tuned/plugins/plugin_sysctl.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tuned/plugins/plugin_sysctl.py b/tuned/plugins/plugin_sysctl.py
index 9088bf0..537c896 100644
--- a/tuned/plugins/plugin_sysctl.py
+++ b/tuned/plugins/plugin_sysctl.py
@@ -76,7 +76,7 @@ class SysctlPlugin(base.Plugin):
curr_val = _read_sysctl(option)
value = self._process_assignment_modifiers(self._variables.expand(value), curr_val)
if value is not None:
- if self._verify_value(option, self._cmd.remove_ws(value), curr_val, ignore_missing) == False:
+ if self._verify_value(option, self._cmd.remove_ws(value), self._cmd.remove_ws(curr_val), ignore_missing) == False:
ret = False
return ret
--
2.20.1

32
SOURCES/0001-functions-Return-an-ordered-cpu-list-in-cpulist_onli.patch

@ -0,0 +1,32 @@ @@ -0,0 +1,32 @@
From e0bf0252a45a60b9cf4d359c3bf171baed28ba70 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>
Date: Thu, 9 May 2019 10:23:07 +0200
Subject: [PATCH] functions: Return an ordered cpu list in cpulist_online
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

cpulist_unpack, which is used in the function, returns an ordered cpu
list, however by converting it to a set, the order is lost. Rewrite the
operation in a way that preserves the order.

Resolves: rhbz#1706171

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
---
tuned/profiles/functions/function_cpulist_online.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tuned/profiles/functions/function_cpulist_online.py b/tuned/profiles/functions/function_cpulist_online.py
index 1badf3d..64d930c 100644
--- a/tuned/profiles/functions/function_cpulist_online.py
+++ b/tuned/profiles/functions/function_cpulist_online.py
@@ -19,4 +19,4 @@ class cpulist_online(base.Function):
return None
cpus = self._cmd.cpulist_unpack(",".join(args))
online = self._cmd.cpulist_unpack(self._cmd.read_file("/sys/devices/system/cpu/online"))
- return ",".join(str(v) for v in set(cpus).intersection(set(online)))
+ return ",".join(str(v) for v in cpus if v in online)
--
2.20.1

68
SOURCES/0001-sysctl-Ignore-non-existent-settings-from-system-sysc.patch

@ -0,0 +1,68 @@ @@ -0,0 +1,68 @@
From fb6d2cc90e09e85586bf5599c298fb01c3f01eee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>
Date: Wed, 29 May 2019 17:07:55 +0200
Subject: [PATCH] sysctl: Ignore non-existent settings from system sysctl
configs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Ignore non-existent sysctl settings from the system configuration files
(/etc/sysctl.conf, etc.). Logging errors about these settings hurts user
experience, if the non-existent settings are in fact real settings that
are just temporarily unavailable. For example, the following settings
(from /usr/lib/sysctl.d/00-system.conf on RHEL-7) are not available until
the br_netfilter module is loaded. However once that module is loaded,
it is often desirable to set these, so having them in a RHEL-provided
configuration file makes sense.

net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0

This change restores the old behaviour before the recent rewrite of the
sysctl plugin away from using the 'sysctl' program (running
'sysctl --system' ignores missing settings).

Resolves: rhbz#1714595

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
---
tuned/plugins/plugin_sysctl.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tuned/plugins/plugin_sysctl.py b/tuned/plugins/plugin_sysctl.py
index 537c896..13e2eac 100644
--- a/tuned/plugins/plugin_sysctl.py
+++ b/tuned/plugins/plugin_sysctl.py
@@ -133,7 +133,7 @@ def _apply_sysctl_config_line(path, lineno, line):
% (path, lineno))
return
value = value.strip()
- _write_sysctl(option, value)
+ _write_sysctl(option, value, ignore_missing = True)
def _get_sysctl_path(option):
return "/proc/sys/%s" % option.replace(".", "/")
@@ -161,7 +161,7 @@ def _read_sysctl(option):
% (option, str(e)))
return None
-def _write_sysctl(option, value):
+def _write_sysctl(option, value, ignore_missing = False):
path = _get_sysctl_path(option)
if os.path.basename(path) in DEPRECATED_SYSCTL_OPTIONS:
log.error("Refusing to set deprecated sysctl option %s"
@@ -175,7 +175,8 @@ def _write_sysctl(option, value):
return True
except (OSError, IOError) as e:
if e.errno == errno.ENOENT:
- log.error("Failed to set sysctl parameter '%s' to '%s', the parameter does not exist"
+ log_func = log.debug if ignore_missing else log.error
+ log_func("Failed to set sysctl parameter '%s' to '%s', the parameter does not exist"
% (option, value))
else:
log.error("Failed to set sysctl parameter '%s' to '%s': %s"
--
2.20.1

33
SOURCES/0001-virtual-host-Fix-setting-force_latency.patch

@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
From 96363628f728f296d2efc69d1d3914afdfbbb844 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>
Date: Thu, 25 Apr 2019 10:42:03 +0200
Subject: [PATCH] virtual-host: Fix setting force_latency
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The force_latency parameter belongs to the cpu plugin, so that's the
section it needs to be in.

Fixes #132
Resolves: rhbz#1569375

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
---
profiles/virtual-host/tuned.conf | 1 +
1 file changed, 1 insertion(+)

diff --git a/profiles/virtual-host/tuned.conf b/profiles/virtual-host/tuned.conf
index 7bd3330..ca493d6 100644
--- a/profiles/virtual-host/tuned.conf
+++ b/profiles/virtual-host/tuned.conf
@@ -16,5 +16,6 @@ vm.dirty_background_ratio = 5
# (system default is 500000, i.e. 0.5 ms)
kernel.sched_migration_cost_ns = 5000000
+[cpu]
# Setting C3 state sleep mode/power savings
force_latency=70
--
2.20.1

41
SOURCES/tuned-2.11.0-realtime-virtual-profiles-enable-ktimer-lockless-check.patch

@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
diff --git a/profiles/realtime-virtual-guest/script.sh b/profiles/realtime-virtual-guest/script.sh
index 33cb730..ce94a4b 100755
--- a/profiles/realtime-virtual-guest/script.sh
+++ b/profiles/realtime-virtual-guest/script.sh
@@ -2,8 +2,13 @@
. /usr/lib/tuned/functions
+KTIMER_LOCKLESS_FILE=/sys/kernel/ktimer_lockless_check
+
start() {
systemctl start rt-entsk
+ if [ -f $KTIMER_LOCKLESS_FILE ]; then
+ echo 1 > $KTIMER_LOCKLESS_FILE
+ fi
return "$?"
}
diff --git a/profiles/realtime-virtual-host/script.sh b/profiles/realtime-virtual-host/script.sh
index 8ff5509..be1804f 100755
--- a/profiles/realtime-virtual-host/script.sh
+++ b/profiles/realtime-virtual-host/script.sh
@@ -5,6 +5,7 @@
CACHE_VALUE_FILE=./lapic_timer_adv_ns
CACHE_CPU_FILE=./lapic_timer_adv_ns.cpumodel
KVM_LAPIC_FILE=/sys/module/kvm/parameters/lapic_timer_advance_ns
+KTIMER_LOCKLESS_FILE=/sys/kernel/ktimer_lockless_check
QEMU=$(type -P qemu-kvm || echo /usr/libexec/qemu-kvm)
TSCDEADLINE_LATENCY="/usr/share/qemu-kvm/tscdeadline_latency.flat"
if [ ! -f "$TSCDEADLINE_LATENCY" ]; then
@@ -100,6 +101,10 @@ start() {
fi
systemctl start rt-entsk
+ if [ -f $KTIMER_LOCKLESS_FILE ]; then
+ echo 1 > $KTIMER_LOCKLESS_FILE
+ fi
+
return 0
}

14
SOURCES/tuned-2.11.0-sap-hana-vmware-deprecation.patch

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
diff --git a/man/tuned-profiles-sap-hana.7 b/man/tuned-profiles-sap-hana.7
index e199f27..a56274c 100644
--- a/man/tuned-profiles-sap-hana.7
+++ b/man/tuned-profiles-sap-hana.7
@@ -37,6 +37,9 @@ regarding semaphores.
.TP
.BI "sap\-hana\-vmware"
+Deprecated profile. It is being kept here for backward compatibility.
+Original description follows:
+
A performance optimized profile for the SAP HANA applications on VMware.
It is based on throughput\-performance profile. It additionally disables
transparent hugepages, locks CPU to the low C states (by PM QoS) and tunes sysctl

45
SOURCES/tuned-2.11.0-sysctl-modifiers-traceback-fix.patch

@ -0,0 +1,45 @@ @@ -0,0 +1,45 @@
From a8f2a8306e1bac6cfc739e6753d381bf509c995e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= <jskarvad@redhat.com>
Date: Fri, 9 Aug 2019 11:40:48 +0200
Subject: [PATCH] plugin_sysctl: fixed traceback with modifiers '>', '<' and
orig==new
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It fixed the following problem e.g. the profile:
[sysctl]
kernel.pid_max=>131072

and if kernel.pid_max is already 131072 Tuned shows traceback.

Resolves: rhbz#1739418

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
---
tuned/plugins/plugin_sysctl.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tuned/plugins/plugin_sysctl.py b/tuned/plugins/plugin_sysctl.py
index bcaead2..b298bfa 100644
--- a/tuned/plugins/plugin_sysctl.py
+++ b/tuned/plugins/plugin_sysctl.py
@@ -54,12 +54,13 @@ class SysctlPlugin(base.Plugin):
log.error("sysctl option %s will not be set, failed to read the original value."
% option)
else:
- instance._sysctl_original[option] = original_value
new_value = self._variables.expand(
self._cmd.unquote(value))
new_value = self._process_assignment_modifiers(
new_value, original_value)
- _write_sysctl(option, new_value)
+ if new_value is not None:
+ instance._sysctl_original[option] = original_value
+ _write_sysctl(option, new_value)
storage_key = self._storage_key(instance.name)
self._storage.set(storage_key, instance._sysctl_original)
--
2.20.1

115
SPECS/tuned.spec

@ -6,24 +6,32 @@ @@ -6,24 +6,32 @@

Summary: A dynamic adaptive system tuning daemon
Name: tuned
Version: 2.10.0
Release: 6%{?prerel1}%{?dist}
Version: 2.11.0
Release: 8%{?prerel1}%{?dist}
License: GPLv2+
Source: https://github.com/redhat-performance/%{name}/archive/v%{version}%{?prerel2}.tar.gz#/%{name}-%{version}%{?prerel2}.tar.gz
URL: http://www.tuned-project.org/
BuildArch: noarch
BuildRequires: python, systemd, desktop-file-utils
BuildRequires: python, python-devel, systemd, desktop-file-utils
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
# kernel-tools, hdparm, python-dmidecode dependencies are not met on s390
Requires: virt-what, python-configobj, ethtool, gawk
Requires: util-linux, python-perf, dbus, polkit, python-linux-procfs
Requires: python-schedutils
Patch0: tuned-2.10.0-gtk-3.8.patch
Patch1: tuned-2.10.0-use-online-cpus.patch
Patch2: tuned-2.10.0-realtime-virtual-enable-rt-entsk.patch
# Upstream patch:
Patch1: 0001-virtual-host-Fix-setting-force_latency.patch
# Upstream patch:
Patch2: 0001-functions-Return-an-ordered-cpu-list-in-cpulist_onli.patch
# Upstream patch:
Patch3: 0001-Fix-verifying-sysctl-options-with-tabs.patch
# Upstream patch:
Patch4: 0001-sysctl-Ignore-non-existent-settings-from-system-sysc.patch
Patch5: tuned-2.11.0-sap-hana-vmware-deprecation.patch
Patch6: tuned-2.11.0-sysctl-modifiers-traceback-fix.patch
Patch7: tuned-2.11.0-realtime-virtual-profiles-enable-ktimer-lockless-check.patch

%description
The tuned package contains a daemon that tunes system settings dynamically.
@ -157,17 +165,20 @@ It can be also used to fine tune your system for specific scenarios. @@ -157,17 +165,20 @@ It can be also used to fine tune your system for specific scenarios.

%prep
%setup -q -n %{name}-%{version}%{?prerel2}
%patch0 -p1
%patch1 -p1
%patch2 -p1
# workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1626473
chmod 0755 profiles/realtime-virtual-guest/script.sh
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1


%build


%install
make install DESTDIR=%{buildroot} DOCDIR=%{docdir} PYTHON=python2
make install DESTDIR=%{buildroot} DOCDIR=%{docdir} PYTHON=%{__python2}
%if 0%{?rhel}
sed -i 's/\(dynamic_tuning[ \t]*=[ \t]*\).*/\10/' %{buildroot}%{_sysconfdir}/tuned/tuned-main.conf
%endif
@ -185,11 +196,12 @@ mkdir -p %{buildroot}%{_var}/lib/tuned @@ -185,11 +196,12 @@ mkdir -p %{buildroot}%{_var}/lib/tuned
mkdir -p %{buildroot}%{_sysconfdir}/modprobe.d
touch %{buildroot}%{_sysconfdir}/modprobe.d/kvm.rt.tuned.conf

# BLS not supported, no need to install kernel hooks
rm -rf %{buildroot}%{_prefix}/lib/kernel

# validate desktop file
desktop-file-validate %{buildroot}%{_datadir}/applications/tuned-gui.desktop

mkdir -p %{buildroot}%{_sysconfdir}/tuned/recommend.d

%post
%systemd_post tuned.service

@ -321,7 +333,6 @@ fi @@ -321,7 +333,6 @@ fi
%{_sbindir}/tuned-gui
%{python_sitelib}/tuned/gtk
%{_datadir}/tuned/ui
%{_datadir}/polkit-1/actions/com.redhat.tuned.gui.policy
%{_datadir}/icons/hicolor/scalable/apps/tuned.svg
%{_datadir}/applications/tuned-gui.desktop

@ -412,6 +423,82 @@ fi @@ -412,6 +423,82 @@ fi
%{_mandir}/man7/tuned-profiles-compat.7*

%changelog
* Wed Aug 14 2019 Jaroslav Škarvada <jskarvad@redhat.com> - 2.11.0-8
- realtime-virtual-guest/host: enabled ktimer-lockless-check
Resolves: rhbz#1730016

* Fri Aug 9 2019 Jaroslav Škarvada <jskarvad@redhat.com> - 2.11.0-7
- plugin_sysctl: fixed traceback when assignments modifiers ('<', '>')
are used with sysctl and the current sysctl value is the same as
the new value
Resolves: rhbz#1739418

* Tue Jul 30 2019 Jaroslav Škarvada <jskarvad@redhat.com> - 2.11.0-6
- sap-hana-vmware: deprecated profile
Resolves: rhbz#1672213

* Fri Jun 07 2019 Ondřej Lysoněk <olysonek@redhat.com> - 2.11.0-5
- Ignore non-existent settings from system sysctl configs
- Resolves: rhbz#1714595

* Fri May 17 2019 Ondřej Lysoněk <olysonek@redhat.com> - 2.11.0-4
- Fixed verification of sysctl parameters whose values contain tabs
- Resolves: rhbz#1711230

* Tue May 14 2019 Ondřej Lysoněk <olysonek@redhat.com> - 2.11.0-3
- Fixed assertion that isolated_cores contain online CPUs
- Resolves: rhbz#1706171

* Thu Apr 25 2019 Ondřej Lysoněk <olysonek@redhat.com> - 2.11.0-2
- Fix setting force_latency in the virtual-host profile
- Resolves: rhbz#1569375

* Thu Mar 21 2019 Jaroslav Škarvada <jskarvad@redhat.com> - 2.11.0-1
- new release
- rebased tuned to latest upstream
related: rhbz#1643654
- used dmidecode only on x86 architectures
resolves: rhbz#1688371
- recommend: fixed to work without tuned daemon running
resolves: rhbz#1687397

* Sun Mar 10 2019 Jaroslav Škarvada <jskarvad@redhat.com> - 2.11.0-0.1.rc1
- new release
- rebased tuned to latest upstream
resolves: rhbz#1643654
- disable KSM only once, re-enable it only on full rollback
resolves: rhbz#1622239
- functions: reworked setup_kvm_mod_low_latency to count with kernel changes
resolves: rhbz#1649408
- updated virtual-host profile
resolves: rhbz#1569375
- added log message for unsupported parameters in plugin_net
resolves: rhbz#1533852
- added range feature for cpu exclusion
resolves: rhbz#1533908
- make a copy of devices when verifying tuning
resolves: rhbz#1592743
- fixed disk plugin/plugout problem
resolves: rhbz#1595156
- fixed unit configuration reading
resolves: rhbz#1613379
- reload profile configuration on SIGHUP
resolves: rhbz#1631744
- use built-in functionality to apply system sysctl
resolves: rhbz#1663412

* Tue Nov 27 2018 Jaroslav Škarvada <jskarvad@redhat.com> - 2.10.0-9
- Updated disable-ksm-once patch
Related: rhbz#1622239

* Thu Nov 22 2018 Jaroslav Škarvada <jskarvad@redhat.com> - 2.10.0-8
- Reworked setup_kvm_mod_low_latency to count with kernel changes
Resolves: rhbz#1649408

* Thu Nov 22 2018 Jaroslav Škarvada <jskarvad@redhat.com> - 2.10.0-7
- Disable ksm once, re-enable it on full rollback
Resolves: rhbz#1622239

* Fri Sep 7 2018 Jaroslav Škarvada <jskarvad@redhat.com> - 2.10.0-6
- Added workaround for rpmbuild bug 1626473
related: rhbz#1616043

Loading…
Cancel
Save