From aa6282fd9504677bc3813fd1f88f276072254ddd Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 20 2018 16:19:31 +0000 Subject: import tuned-2.9.0-1.el7_5.2 --- diff --git a/SOURCES/tuned-2.9.0-scheduler-blacklist-thread-names.patch b/SOURCES/tuned-2.9.0-scheduler-blacklist-thread-names.patch new file mode 100644 index 0000000..37b2dcd --- /dev/null +++ b/SOURCES/tuned-2.9.0-scheduler-blacklist-thread-names.patch @@ -0,0 +1,43 @@ +diff --git a/tuned/plugins/plugin_scheduler.py b/tuned/plugins/plugin_scheduler.py +index 25c38dd..07fac52 100644 +--- a/tuned/plugins/plugin_scheduler.py ++++ b/tuned/plugins/plugin_scheduler.py +@@ -379,8 +379,12 @@ class SchedulerPlugin(base.Plugin): + + def _set_all_obj_affinity(self, objs, affinity, threads = False, intersect = False): + _affinity = affinity +- for obj in objs: +- if self._affinity_changeable(obj, process = objs[obj]) != 1: ++ psl = [v for v in objs if re.search(self._ps_whitelist, self._get_stat_comm(v)) is not None] ++ if self._ps_blacklist != "": ++ psl = [v for v in psl if re.search(self._ps_blacklist, self._get_stat_comm(v)) is None] ++ psd = dict([(v.pid, v) for v in psl]) ++ for obj in psd: ++ if self._affinity_changeable(obj, process = psd[obj]) != 1: + continue + prev_affinity = self._get_affinity2(obj) + if prev_affinity is None: +@@ -391,8 +395,8 @@ class SchedulerPlugin(base.Plugin): + if not self._set_affinity2(obj, _affinity): + continue + # process threads +- if not threads and objs[obj].has_key("threads"): +- self._set_all_obj_affinity(dict(objs[obj]["threads"].items()), affinity, True, intersect) ++ if not threads and "threads" in psd[obj]: ++ self._set_all_obj_affinity(psd[obj]["threads"].values(), affinity, True, intersect) + + def _get_stat_comm(self, o): + try: +@@ -405,11 +409,7 @@ class SchedulerPlugin(base.Plugin): + affinity_hex = self._cmd.cpulist2hex(_affinity) + ps = procfs.pidstats() + ps.reload_threads() +- psl = filter(lambda v: re.search(self._ps_whitelist, self._get_stat_comm(v)) is not None, ps.values()) +- if self._ps_blacklist != "": +- psl = filter(lambda v: re.search(self._ps_blacklist, self._get_stat_comm(v)) is None, psl) +- psd = dict(map(lambda v: (v.pid, v), psl)) +- self._set_all_obj_affinity(psd, affinity, False, intersect) ++ self._set_all_obj_affinity(ps.values(), affinity, False, intersect) + + # process IRQs + irqs = procfs.interrupts() diff --git a/SOURCES/tuned-2.9.0-use-online-cpus.patch b/SOURCES/tuned-2.9.0-use-online-cpus.patch new file mode 100644 index 0000000..3165038 --- /dev/null +++ b/SOURCES/tuned-2.9.0-use-online-cpus.patch @@ -0,0 +1,104 @@ +diff --git a/profiles/cpu-partitioning/tuned.conf b/profiles/cpu-partitioning/tuned.conf +index 3c52215..1821b74 100644 +--- a/profiles/cpu-partitioning/tuned.conf ++++ b/profiles/cpu-partitioning/tuned.conf +@@ -19,13 +19,13 @@ tmpdir=${f:strip:${f:exec:/usr/bin/mktemp:-d}} + isolated_cores_expanded=${f:cpulist_unpack:${isolated_cores}} + isolated_cpumask=${f:cpulist2hex:${isolated_cores_expanded}} + not_isolated_cores_expanded=${f:cpulist_invert:${isolated_cores_expanded}} +-isolated_cores_present_expanded=${f:cpulist_present:${isolated_cores}} +-not_isolated_cores_present_expanded=${f:cpulist_present:${not_isolated_cores_expanded}} ++isolated_cores_online_expanded=${f:cpulist_online:${isolated_cores}} ++not_isolated_cores_online_expanded=${f:cpulist_online:${not_isolated_cores_expanded}} + not_isolated_cpumask=${f:cpulist2hex:${not_isolated_cores_expanded}} + no_balance_cores_expanded=${f:cpulist_unpack:${no_balance_cores}} + +-# Fail if isolated_cores contains CPUs which are not present +-assert2=${f:assertion:isolated_cores contains present CPU(s):${isolated_cores_expanded}:${isolated_cores_present_expanded}} ++# Fail if isolated_cores contains CPUs which are not online ++assert2=${f:assertion:isolated_cores contains online CPU(s):${isolated_cores_expanded}:${isolated_cores_online_expanded}} + + [sysctl] + kernel.hung_task_timeout_secs = 600 +diff --git a/profiles/realtime-virtual-guest/tuned.conf b/profiles/realtime-virtual-guest/tuned.conf +index cf349ef..05cf783 100644 +--- a/profiles/realtime-virtual-guest/tuned.conf ++++ b/profiles/realtime-virtual-guest/tuned.conf +@@ -15,10 +15,10 @@ isolated_cores_assert_check = \\${isolated_cores} + assert1=${f:assertion_non_equal:isolated_cores are set:${isolated_cores}:${isolated_cores_assert_check}} + + isolated_cores_expanded=${f:cpulist_unpack:${isolated_cores}} +-isolated_cores_present_expanded=${f:cpulist_present:${isolated_cores}} ++isolated_cores_online_expanded=${f:cpulist_online:${isolated_cores}} + +-# Fail if isolated_cores contains CPUs which are not present +-assert2=${f:assertion:isolated_cores contains present CPU(s):${isolated_cores_expanded}:${isolated_cores_present_expanded}} ++# Fail if isolated_cores contains CPUs which are not online ++assert2=${f:assertion:isolated_cores contains online CPU(s):${isolated_cores_expanded}:${isolated_cores_online_expanded}} + + [scheduler] + # group.group_name=rule_priority:scheduler_policy:scheduler_priority:core_affinity_in_hex:process_name_regex +diff --git a/profiles/realtime-virtual-host/tuned.conf b/profiles/realtime-virtual-host/tuned.conf +index 828e519..f64e22a 100644 +--- a/profiles/realtime-virtual-host/tuned.conf ++++ b/profiles/realtime-virtual-host/tuned.conf +@@ -32,10 +32,10 @@ isolated_cores_assert_check = \\${isolated_cores} + assert1=${f:assertion_non_equal:isolated_cores are set:${isolated_cores}:${isolated_cores_assert_check}} + + isolated_cores_expanded=${f:cpulist_unpack:${isolated_cores}} +-isolated_cores_present_expanded=${f:cpulist_present:${isolated_cores}} ++isolated_cores_online_expanded=${f:cpulist_online:${isolated_cores}} + +-# Fail if isolated_cores contains CPUs which are not present +-assert2=${f:assertion:isolated_cores contains present CPU(s):${isolated_cores_expanded}:${isolated_cores_present_expanded}} ++# Fail if isolated_cores contains CPUs which are not online ++assert2=${f:assertion:isolated_cores contains online CPU(s):${isolated_cores_expanded}:${isolated_cores_online_expanded}} + + [scheduler] + # group.group_name=rule_priority:scheduler_policy:scheduler_priority:core_affinity_in_hex:process_name_regex +diff --git a/profiles/realtime/tuned.conf b/profiles/realtime/tuned.conf +index 6feee3f..6b3676b 100644 +--- a/profiles/realtime/tuned.conf ++++ b/profiles/realtime/tuned.conf +@@ -18,10 +18,10 @@ assert1=${f:assertion_non_equal:isolated_cores are set:${isolated_cores}:${isola + # Non-isolated cores cpumask including offline cores + not_isolated_cpumask = ${f:cpulist2hex_invert:${isolated_cores}} + isolated_cores_expanded=${f:cpulist_unpack:${isolated_cores}} +-isolated_cores_present_expanded=${f:cpulist_present:${isolated_cores}} ++isolated_cores_online_expanded=${f:cpulist_online:${isolated_cores}} + +-# Fail if isolated_cores contains CPUs which are not present +-assert2=${f:assertion:isolated_cores contains present CPU(s):${isolated_cores_expanded}:${isolated_cores_present_expanded}} ++# Fail if isolated_cores contains CPUs which are not online ++assert2=${f:assertion:isolated_cores contains online CPU(s):${isolated_cores_expanded}:${isolated_cores_online_expanded}} + + [sysctl] + kernel.hung_task_timeout_secs = 600 +diff --git a/tuned/profiles/functions/function_cpulist_invert.py b/tuned/profiles/functions/function_cpulist_invert.py +index 2a3c9ea..52f8270 100644 +--- a/tuned/profiles/functions/function_cpulist_invert.py ++++ b/tuned/profiles/functions/function_cpulist_invert.py +@@ -8,7 +8,7 @@ log = tuned.logs.get() + class cpulist_invert(base.Function): + """ + Inverts list of CPUs (makes its complement). For the complement it +- gets number of present CPUs from the /sys/devices/system/cpu/present, ++ gets number of present CPUs from the /sys/devices/system/cpu/online, + e.g. system with 4 CPUs (0-3), the inversion of list "0,2,3" will be + "1" + """ +diff --git a/tuned/utils/commands.py b/tuned/utils/commands.py +index f8e393f..3299f4c 100644 +--- a/tuned/utils/commands.py ++++ b/tuned/utils/commands.py +@@ -355,8 +355,8 @@ class commands: + # Inverts CPU list (i.e. makes its complement) + def cpulist_invert(self, l): + cpus = self.cpulist_unpack(l) +- present = self.cpulist_unpack(self.read_file("/sys/devices/system/cpu/present")) +- return list(set(present) - set(cpus)) ++ online = self.cpulist_unpack(self.read_file("/sys/devices/system/cpu/online")) ++ return list(set(online) - set(cpus)) + + # Converts CPU list to hexadecimal CPU mask + def cpulist2hex(self, l): diff --git a/SPECS/tuned.spec b/SPECS/tuned.spec index ff40cc3..d22bf31 100644 --- a/SPECS/tuned.spec +++ b/SPECS/tuned.spec @@ -7,7 +7,7 @@ Summary: A dynamic adaptive system tuning daemon Name: tuned Version: 2.9.0 -Release: 1%{?prerel1}%{?dist} +Release: 1%{?prerel1}%{?dist}.2 License: GPLv2+ Source: https://github.com/redhat-performance/%{name}/archive/v%{version}%{?prerel2}.tar.gz#/%{name}-%{version}%{?prerel1}.tar.gz URL: http://www.tuned-project.org/ @@ -22,6 +22,8 @@ Requires: virt-what, python-configobj, ethtool, gawk Requires: util-linux, python-perf, dbus, polkit, python-linux-procfs Requires: python-schedutils Patch0: tuned-2.8.0-gtk-3.8.patch +Patch1: tuned-2.9.0-scheduler-blacklist-thread-names.patch +Patch2: tuned-2.9.0-use-online-cpus.patch %description The tuned package contains a daemon that tunes system settings dynamically. @@ -149,6 +151,8 @@ 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 %build @@ -394,6 +398,14 @@ fi %{_mandir}/man7/tuned-profiles-compat.7* %changelog +* Wed Aug 8 2018 Jaroslav Škarvada - 2.9.0-1.2 +- use online CPUs for cpusets calculations instead of present CPUs + resolves: rhbz#1613951 + +* Wed Jul 4 2018 Jaroslav Škarvada - 2.9.0-1.1 +- plugin_scheduler: whitelist/blacklist processed also for thread names + resolves: rhbz#1598031 + * Sun Oct 29 2017 Jaroslav Škarvada - 2.9.0-1 - new release - rebased tuned to latest upstream