new release
rebased tuned to latest upstream resolves: rhbz#1944643 realtime: disabled kvm.nx_huge_page kernel module option in realtime-virtual-host profile resolves: rhbz#1976825 realtime: explicitly set 'irqaffinity=~<isolated_cpu_mask>' in kernel command line resolves: rhbz#1974820 scheduler: added abstraction for the sched_* and numa_* variables which were previously accessible through the sysctl resolves: rhbz#1952687 recommend: fixed wrong profile on ppc64le bare metal servers resolves: rhbz#1959889
This commit is contained in:
parent
3dd8ec2ff7
commit
05f73c8d8c
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
tuned-*.tar.gz
|
||||
/tuned-*.tar.gz
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (tuned-2.15.0.tar.gz) = 67acdf10ecccd7910c4dcfd737610b4cb7651c7bf937bc0ed9c51869262d9f3a46f262d0b7636bc7a86a8abf579542a46f551e4f6c7561a061d8d58459be4589
|
||||
SHA512 (tuned-2.16.0.tar.gz) = 35f04e1ee1ab3d8be711f0787db92c089cc210c75a3be0bc60389effaed8dc3fb502eff54ea0336154563f7b194f8ff286a2e408ab439a472b6d4922c64d5b03
|
||||
|
@ -1,194 +0,0 @@
|
||||
diff --git a/tuned/plugins/plugin_scheduler.py b/tuned/plugins/plugin_scheduler.py
|
||||
index 32b9c1a..2b55f8b 100644
|
||||
--- a/tuned/plugins/plugin_scheduler.py
|
||||
+++ b/tuned/plugins/plugin_scheduler.py
|
||||
@@ -12,12 +12,16 @@ import perf
|
||||
import select
|
||||
import tuned.consts as consts
|
||||
import procfs
|
||||
-import schedutils
|
||||
from tuned.utils.commands import commands
|
||||
import errno
|
||||
import os
|
||||
import collections
|
||||
import math
|
||||
+# Check existence of scheduler API in os module
|
||||
+try:
|
||||
+ os.SCHED_FIFO
|
||||
+except AttributeError:
|
||||
+ import schedutils
|
||||
|
||||
log = tuned.logs.get()
|
||||
|
||||
@@ -52,20 +56,90 @@ class IRQAffinities(object):
|
||||
# IRQs that don't support changing CPU affinity:
|
||||
self.unchangeable = []
|
||||
|
||||
+class SchedulerUtils(object):
|
||||
+ """
|
||||
+ Class encapsulating scheduler implementation in os module
|
||||
+ """
|
||||
+
|
||||
+ _dict_schedcfg2schedconst = {
|
||||
+ "f": "SCHED_FIFO",
|
||||
+ "b": "SCHED_BATCH",
|
||||
+ "r": "SCHED_RR",
|
||||
+ "o": "SCHED_OTHER",
|
||||
+ "i": "SCHED_IDLE",
|
||||
+ }
|
||||
+
|
||||
+ def __init__(self):
|
||||
+ # {"f": os.SCHED_FIFO...}
|
||||
+ self._dict_schedcfg2num = dict((k, getattr(os, name)) for k, name in self._dict_schedcfg2schedconst.items())
|
||||
+ # { os.SCHED_FIFO: "SCHED_FIFO"... }
|
||||
+ self._dict_num2schedconst = dict((getattr(os, name), name) for name in self._dict_schedcfg2schedconst.values())
|
||||
+
|
||||
+ def sched_cfg_to_num(self, str_scheduler):
|
||||
+ return self._dict_schedcfg2num.get(str_scheduler)
|
||||
+
|
||||
+ # Reimplementation of schedstr from schedutils for logging purposes
|
||||
+ def sched_num_to_const(self, scheduler):
|
||||
+ return self._dict_num2schedconst.get(scheduler)
|
||||
+
|
||||
+ def get_scheduler(self, pid):
|
||||
+ return os.sched_getscheduler(pid)
|
||||
+
|
||||
+ def set_scheduler(self, pid, sched, prio):
|
||||
+ os.sched_setscheduler(pid, sched, os.sched_param(prio))
|
||||
+
|
||||
+ def get_affinity(self, pid):
|
||||
+ return os.sched_getaffinity(pid)
|
||||
+
|
||||
+ def set_affinity(self, pid, affinity):
|
||||
+ os.sched_setaffinity(pid, affinity)
|
||||
+
|
||||
+ def get_priority(self, pid):
|
||||
+ return os.sched_getparam(pid).sched_priority
|
||||
+
|
||||
+ def get_priority_min(self, sched):
|
||||
+ return os.sched_get_priority_min(sched)
|
||||
+
|
||||
+ def get_priority_max(self, sched):
|
||||
+ return os.sched_get_priority_max(sched)
|
||||
+
|
||||
+class SchedulerUtilsSchedutils(SchedulerUtils):
|
||||
+ """
|
||||
+ Class encapsulating scheduler implementation in schedutils module
|
||||
+ """
|
||||
+ def __init__(self):
|
||||
+ # { "f": schedutils.SCHED_FIFO... }
|
||||
+ self._dict_schedcfg2num = dict((k, getattr(schedutils, name)) for k, name in self._dict_schedcfg2schedconst.items())
|
||||
+ # { schedutils.SCHED_FIFO: "SCHED_FIFO"... }
|
||||
+ self._dict_num2schedconst = dict((getattr(schedutils, name), name) for name in self._dict_schedcfg2schedconst.values())
|
||||
+
|
||||
+ def get_scheduler(self, pid):
|
||||
+ return schedutils.get_scheduler(pid)
|
||||
+
|
||||
+ def set_scheduler(self, pid, sched, prio):
|
||||
+ schedutils.set_scheduler(pid, sched, prio)
|
||||
+
|
||||
+ def get_affinity(self, pid):
|
||||
+ return schedutils.get_affinity(pid)
|
||||
+
|
||||
+ def set_affinity(self, pid, affinity):
|
||||
+ schedutils.set_affinity(pid, affinity)
|
||||
+
|
||||
+ def get_priority(self, pid):
|
||||
+ return schedutils.get_priority(pid)
|
||||
+
|
||||
+ def get_priority_min(self, sched):
|
||||
+ return schedutils.get_priority_min(sched)
|
||||
+
|
||||
+ def get_priority_max(self, sched):
|
||||
+ return schedutils.get_priority_max(sched)
|
||||
+
|
||||
class SchedulerPlugin(base.Plugin):
|
||||
"""
|
||||
Plugin for tuning of scheduler. Currently it can control scheduling
|
||||
priorities of system threads (it is substitution for the rtctl tool).
|
||||
"""
|
||||
|
||||
- _dict_schedcfg2num = {
|
||||
- "f": schedutils.SCHED_FIFO,
|
||||
- "b": schedutils.SCHED_BATCH,
|
||||
- "r": schedutils.SCHED_RR,
|
||||
- "o": schedutils.SCHED_OTHER,
|
||||
- "i": schedutils.SCHED_IDLE,
|
||||
- }
|
||||
-
|
||||
def __init__(self, monitor_repository, storage_factory, hardware_inventory, device_matcher, device_matcher_udev, plugin_instance_factory, global_cfg, variables):
|
||||
super(SchedulerPlugin, self).__init__(monitor_repository, storage_factory, hardware_inventory, device_matcher, device_matcher_udev, plugin_instance_factory, global_cfg, variables)
|
||||
self._has_dynamic_options = True
|
||||
@@ -83,6 +157,10 @@ class SchedulerPlugin(base.Plugin):
|
||||
command_name = "scheduler")
|
||||
self._irq_storage_key = self._storage_key(
|
||||
command_name = "irq")
|
||||
+ try:
|
||||
+ self._scheduler_utils = SchedulerUtils()
|
||||
+ except AttributeError:
|
||||
+ self._scheduler_utils = SchedulerUtilsSchedutils()
|
||||
|
||||
def _calc_mmap_pages(self, mmap_pages):
|
||||
if mmap_pages is None:
|
||||
@@ -216,20 +294,20 @@ class SchedulerPlugin(base.Plugin):
|
||||
# instead of OSError
|
||||
# If PID doesn't exist, errno == ESRCH
|
||||
def _get_rt(self, pid):
|
||||
- scheduler = schedutils.get_scheduler(pid)
|
||||
- sched_str = schedutils.schedstr(scheduler)
|
||||
- priority = schedutils.get_priority(pid)
|
||||
+ scheduler = self._scheduler_utils.get_scheduler(pid)
|
||||
+ sched_str = self._scheduler_utils.sched_num_to_const(scheduler)
|
||||
+ priority = self._scheduler_utils.get_priority(pid)
|
||||
log.debug("Read scheduler policy '%s' and priority '%d' of PID '%d'"
|
||||
% (sched_str, priority, pid))
|
||||
return (scheduler, priority)
|
||||
|
||||
def _set_rt(self, pid, sched, prio):
|
||||
- sched_str = schedutils.schedstr(sched)
|
||||
+ sched_str = self._scheduler_utils.sched_num_to_const(sched)
|
||||
log.debug("Setting scheduler policy to '%s' and priority to '%d' of PID '%d'."
|
||||
% (sched_str, prio, pid))
|
||||
try:
|
||||
- prio_min = schedutils.get_priority_min(sched)
|
||||
- prio_max = schedutils.get_priority_max(sched)
|
||||
+ prio_min = self._scheduler_utils.get_priority_min(sched)
|
||||
+ prio_max = self._scheduler_utils.get_priority_max(sched)
|
||||
if prio < prio_min or prio > prio_max:
|
||||
log.error("Priority for %s must be in range %d - %d. '%d' was given."
|
||||
% (sched_str, prio_min,
|
||||
@@ -240,7 +318,7 @@ class SchedulerPlugin(base.Plugin):
|
||||
log.error("Failed to get allowed priority range: %s"
|
||||
% e)
|
||||
try:
|
||||
- schedutils.set_scheduler(pid, sched, prio)
|
||||
+ self._scheduler_utils.set_scheduler(pid, sched, prio)
|
||||
except (SystemError, OSError) as e:
|
||||
if hasattr(e, "errno") and e.errno == errno.ESRCH:
|
||||
log.debug("Failed to set scheduling parameters of PID %d, the task vanished."
|
||||
@@ -404,7 +482,7 @@ class SchedulerPlugin(base.Plugin):
|
||||
self._scheduler_original[pid].cmdline = cmd
|
||||
|
||||
def _convert_sched_params(self, str_scheduler, str_priority):
|
||||
- scheduler = self._dict_schedcfg2num.get(str_scheduler)
|
||||
+ scheduler = self._scheduler_utils.sched_cfg_to_num(str_scheduler)
|
||||
if scheduler is None and str_scheduler != "*":
|
||||
log.error("Invalid scheduler: %s. Scheduler and priority will be ignored."
|
||||
% str_scheduler)
|
||||
@@ -759,14 +837,14 @@ class SchedulerPlugin(base.Plugin):
|
||||
# instead of OSError
|
||||
# If PID doesn't exist, errno == ESRCH
|
||||
def _get_affinity(self, pid):
|
||||
- res = schedutils.get_affinity(pid)
|
||||
+ res = self._scheduler_utils.get_affinity(pid)
|
||||
log.debug("Read affinity '%s' of PID %d" % (res, pid))
|
||||
return res
|
||||
|
||||
def _set_affinity(self, pid, affinity):
|
||||
log.debug("Setting CPU affinity of PID %d to '%s'." % (pid, affinity))
|
||||
try:
|
||||
- schedutils.set_affinity(pid, affinity)
|
||||
+ self._scheduler_utils.set_affinity(pid, affinity)
|
||||
return True
|
||||
# Workaround for old python-schedutils (pre-0.4) which
|
||||
# incorrectly raised SystemError instead of OSError
|
38
tuned.spec
38
tuned.spec
@ -17,10 +17,11 @@
|
||||
%global make_python_arg PYTHON=%{__python3}
|
||||
%else
|
||||
%{!?python2_sitelib:%global python2_sitelib %{python_sitelib}}
|
||||
%global make_python_arg PYTHON=%{__python2}
|
||||
%if 0%{?rhel} && 0%{?rhel} < 8
|
||||
%global make_python_arg PYTHON=%{__python}
|
||||
%global _py python
|
||||
%else
|
||||
%global make_python_arg PYTHON=%{__python2}
|
||||
%global _py python2
|
||||
%endif
|
||||
%endif
|
||||
@ -33,15 +34,14 @@
|
||||
|
||||
Summary: A dynamic adaptive system tuning daemon
|
||||
Name: tuned
|
||||
Version: 2.15.0
|
||||
Release: 6%{?prerel1}%{?dist}
|
||||
Version: 2.16.0
|
||||
Release: 1%{?prerel1}%{?dist}
|
||||
License: GPLv2+
|
||||
Source0: https://github.com/redhat-performance/%{name}/archive/v%{version}%{?prerel2}/%{name}-%{version}%{?prerel2}.tar.gz
|
||||
# RHEL-9 specific recommend.conf:
|
||||
Source1: recommend.conf
|
||||
URL: http://www.tuned-project.org/
|
||||
BuildArch: noarch
|
||||
BuildRequires: make
|
||||
BuildRequires: systemd, desktop-file-utils
|
||||
%if 0%{?rhel}
|
||||
BuildRequires: asciidoc
|
||||
@ -51,12 +51,20 @@ BuildRequires: asciidoctor
|
||||
Requires(post): systemd, virt-what
|
||||
Requires(preun): systemd
|
||||
Requires(postun): systemd
|
||||
BuildRequires: make
|
||||
BuildRequires: %{_py}, %{_py}-devel
|
||||
# BuildRequires for 'make test'
|
||||
# python-mock is needed for python-2.7, but it's not available on RHEL-7
|
||||
%if %{without python3} && ( ! 0%{?rhel} || 0%{?rhel} >= 8 )
|
||||
BuildRequires: %{_py}-mock
|
||||
%endif
|
||||
BuildRequires: %{_py}-configobj
|
||||
BuildRequires: %{_py}-decorator, %{_py}-pyudev
|
||||
Requires: %{_py}-decorator, %{_py}-pyudev, %{_py}-configobj
|
||||
BuildRequires: %{_py}-pyudev
|
||||
Requires: %{_py}-pyudev, %{_py}-configobj
|
||||
Requires: %{_py}-linux-procfs, %{_py}-perf
|
||||
%if %{without python3}
|
||||
Requires: %{_py}-schedutils
|
||||
%endif
|
||||
# requires for packages with inconsistent python2/3 names
|
||||
%if %{with python3}
|
||||
# BuildRequires for 'make test'
|
||||
@ -86,7 +94,6 @@ Requires: subscription-manager
|
||||
Requires: python3-syspurpose
|
||||
%endif
|
||||
%endif
|
||||
Patch0: tuned-2.15.0-schedutils-drop.patch
|
||||
|
||||
%description
|
||||
The tuned package contains a daemon that tunes system settings dynamically.
|
||||
@ -518,11 +525,26 @@ fi
|
||||
%{_mandir}/man7/tuned-profiles-compat.7*
|
||||
|
||||
%files profiles-postgresql
|
||||
%defattr(-,root,root,-)
|
||||
%{_prefix}/lib/tuned/postgresql
|
||||
%{_mandir}/man7/tuned-profiles-postgresql.7*
|
||||
|
||||
%changelog
|
||||
* Wed Jul 21 2021 Jaroslav Škarvada <jskarvad@redhat.com> - 2.16.0-1
|
||||
- new release
|
||||
- rebased tuned to latest upstream
|
||||
resolves: rhbz#1944643
|
||||
- realtime: disabled kvm.nx_huge_page kernel module option in
|
||||
realtime-virtual-host profile
|
||||
resolves: rhbz#1976825
|
||||
- realtime: explicitly set 'irqaffinity=~<isolated_cpu_mask>' in kernel
|
||||
command line
|
||||
resolves: rhbz#1974820
|
||||
- scheduler: added abstraction for the sched_* and numa_* variables which
|
||||
were previously accessible through the sysctl
|
||||
resolves: rhbz#1952687
|
||||
- recommend: fixed wrong profile on ppc64le bare metal servers
|
||||
resolves: rhbz#1959889
|
||||
|
||||
* Thu May 27 2021 Jaroslav Škarvada <jskarvad@redhat.com> - 2.15.0-6
|
||||
- Dropped python-schedutils
|
||||
Resolves: rhbz#1964680
|
||||
|
Loading…
Reference in New Issue
Block a user