Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
a68b388c26
!36 [sync] PR-34: 修改脏页开始回写的默认百分比
From: @openeuler-sync-bot 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-12-26 01:59:27 +00:00
hongrongxuan
aa1f740fb2 change the default percentage when dirty data starts writeback
(cherry picked from commit 734a42cd20c3fd693afe015beae999fdff9a6b79)
2022-12-26 09:58:57 +08:00
openeuler-ci-bot
ff68ac3f3e
!33 [sync] PR-31: backport some patches to compatible with version 2.10
From: @openeuler-sync-bot 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-11-09 00:51:27 +00:00
liqingqing_1229
4d37d223c7 backport some patches to compatible with version 2.10
(cherry picked from commit 1dc340184afe81007c1b1e671de55e6e2a5c150b)
2022-11-08 21:59:33 +08:00
openeuler-ci-bot
dcd620e420
!30 [sync] PR-28: upgrade to 2.19.0
From: @openeuler-sync-bot 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-10-15 09:36:38 +00:00
liqingqing_1229
33c77296cd upgrade to 2.19.0
(cherry picked from commit af84ab97be33ce36b70498e755ac8bab3f82bb9e)
2022-10-15 17:24:11 +08:00
openeuler-ci-bot
5a4f50d0b1
!26 [sync] PR-11: tuned delete -Sgit from %autosetup, and delete BuildRequires git
From: @openeuler-sync-bot 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-10-15 07:53:24 +00:00
chenyanpanHW
082d1c3f20 delete -Sgit from %autosetup, and delete BuildRequires git
(cherry picked from commit 7d62a7266ad34168b5deb9c013f023f2236a8603)
2022-10-15 15:52:55 +08:00
openeuler-ci-bot
b8a9c583c8
!13 【轻量级PR】修正changelog中的错误日期
From: @konglidong 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-06-20 01:08:45 +00:00
konglidong
4328005f4b modify bad date in changelog 2022-06-16 11:09:19 +08:00
18 changed files with 218 additions and 510 deletions

View File

@ -1,38 +0,0 @@
From 6678c472abbd5f645dbb99ab2946c0e35ded7499 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>
Date: Tue, 10 Jul 2018 00:24:00 +0200
Subject: [PATCH] tuned-adm: Fix a traceback when run without action specified
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Running tuned-adm without an action specified using Python 3 results
in a traceback. This is because in this case parse_args does not
exit with a usage message in Python 3 and the 'action' option
is then undefined.
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
---
tuned-adm.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tuned-adm.py b/tuned-adm.py
index 1b9623d..1df8cc3 100755
--- a/tuned-adm.py
+++ b/tuned-adm.py
@@ -100,7 +100,11 @@ if __name__ == "__main__":
debug = options.pop("debug")
asynco = options.pop("async")
timeout = options.pop("timeout")
- action_name = options.pop("action")
+ try:
+ action_name = options.pop("action")
+ except KeyError:
+ parser.print_usage(file = sys.stderr)
+ sys.exit(1)
log_level = options.pop("loglevel")
result = False
--
2.14.4

View File

@ -1,35 +0,0 @@
From d46834808c3226b3a6e48649df65befc399c21cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>
Date: Wed, 11 Jul 2018 00:41:45 +0200
Subject: [PATCH] tuned-gui: Sort plugins based on their name
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Previously the sorting was done by comparing the objects themselves,
which is not what we want and it doesn't work in Python 3 - TypeError
is raised, e.g:
TypeError: '<' not supported between instances of 'BootloaderPlugin' and 'MountsPlugin'
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
---
tuned-gui.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tuned-gui.py b/tuned-gui.py
index 8f72fd5..e486687 100755
--- a/tuned-gui.py
+++ b/tuned-gui.py
@@ -278,7 +278,8 @@ class Base(object):
self.treestore_profiles = Gtk.ListStore(GObject.TYPE_STRING,
GObject.TYPE_STRING)
self.treestore_plugins = Gtk.ListStore(GObject.TYPE_STRING)
- for plugin in sorted(self.plugin_loader.plugins):
+ for plugin in sorted(self.plugin_loader.plugins,
+ key = lambda plugin: plugin.name):
self.treestore_plugins.append([plugin.name])
self.combobox_plugins = \
self.builder.get_object('comboboxPlugins')
--
2.14.4

View File

@ -1,73 +0,0 @@
From 4790e570ce0e41bde4e1866ed6e3cba723b5f4d8 Mon Sep 17 00:00:00 2001
From: Marcelo Tosatti <mtosatti@redhat.com>
Date: Wed, 4 Jul 2018 17:30:37 -0300
Subject: [PATCH 005/124] realtime-virtual-host: pin only the vcpu thread to
isolated pCPU (v2)
As noted in the bugzilla ticket
https://bugzilla.redhat.com/show_bug.cgi?id=1554851
The QEMU I/O thread can interrupt the time measurement
of the timer. To avoid this problem, only
pin the vCPU thread.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Reviewed-and-Tested-by: Luiz Capitulino <lcapitulino@redhat.com>
v2:
- Use unix sockets (Luiz)
- Proper numeric output (Luiz)
---
profiles/realtime-virtual-host/script.sh | 31 +++++++++++++++++++++----------
1 file changed, 21 insertions(+), 10 deletions(-)
diff --git a/profiles/realtime-virtual-host/script.sh b/profiles/realtime-virtual-host/script.sh
index 515d254..32e962d 100755
--- a/profiles/realtime-virtual-host/script.sh
+++ b/profiles/realtime-virtual-host/script.sh
@@ -17,20 +17,31 @@ run_tsc_deadline_latency()
for i in `seq 1000 500 7000`; do
echo $i > $KVM_LAPIC_FILE
- chrt -f 1 taskset -c $1 $QEMU -enable-kvm -device pc-testdev \
+
+ unixpath=`mktemp`
+
+ chrt -f 1 $QEMU -S -enable-kvm -device pc-testdev \
-device isa-debug-exit,iobase=0xf4,iosize=0x4 \
-display none -serial stdio -device pci-testdev \
-kernel "$TSCDEADLINE_LATENCY" \
- -cpu host | grep latency | cut -f 2 -d ":" > $dir/out
-
- if [ ! -f $dir/out ]; then
- die running $TSCDEADLINE_LATENCY failed
- fi
+ -cpu host \
+ -mon chardev=char0,mode=readline \
+ -chardev socket,id=char0,nowait,path=$unixpath,server | grep latency | cut -f 2 -d ":" > $dir/out &
+
+ sleep 1s
+ pidofvcpu=`echo "info cpus" | nc -U $unixpath | grep thread_id | cut -f 3 -d "=" | tr -d "\r"`
+ taskset -p -c $1 $pidofvcpu >/dev/null
+ echo "cont" | nc -U $unixpath >/dev/null
+ wait
+
+ if [ ! -f $dir/out ]; then
+ die running $TSCDEADLINE_LATENCY failed
+ fi
- tmp=$(wc -l $dir/out | awk '{ print $1 }')
- if [ $tmp -eq 0 ]; then
- die running $TSCDEADLINE_LATENCY failed
- fi
+ tmp=$(wc -l $dir/out | awk '{ print $1 }')
+ if [ $tmp -eq 0 ]; then
+ die running $TSCDEADLINE_LATENCY failed
+ fi
A=0
while read l; do
--
1.8.3.1

View File

@ -1,25 +0,0 @@
From 5c61305860a9520e01b1b66a0bd2fa2b21d70b34 Mon Sep 17 00:00:00 2001
From: Tomas Korbar <tkorbar@redhat.com>
Date: Mon, 23 Jul 2018 14:25:38 +0200
Subject: [PATCH 029/124] Fix TypeError
---
tuned/admin/admin.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tuned/admin/admin.py b/tuned/admin/admin.py
index 3f84413..22ffcde 100644
--- a/tuned/admin/admin.py
+++ b/tuned/admin/admin.py
@@ -73,7 +73,7 @@ class Admin(object):
action = getattr(self, "_action_" + action_name)
except AttributeError as e:
if not self._dbus:
- self._error(e + ", action '%s' is not implemented" % action_name)
+ self._error(str(e) + ", action '%s' is not implemented" % action_name)
return False
if self._dbus:
try:
--
1.8.3.1

View File

@ -1,36 +0,0 @@
From c4f83e29567204eed4eef38bd47393dde88f6134 Mon Sep 17 00:00:00 2001
From: Tomas Korbar <tkorbar@redhat.com>
Date: Tue, 21 Aug 2018 14:38:13 +0200
Subject: [PATCH 040/124] Fix pickle provider
- pickle.load and pickle.dump methods take as a argument
a bytes-like object not a str, python 2.7 is overlooking this but
python 3 is not
---
tuned/storage/pickle_provider.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tuned/storage/pickle_provider.py b/tuned/storage/pickle_provider.py
index 832a9f8..771704d 100644
--- a/tuned/storage/pickle_provider.py
+++ b/tuned/storage/pickle_provider.py
@@ -31,14 +31,14 @@ class PickleProvider(interfaces.Provider):
def save(self):
try:
log.debug("Saving %s" % str(self._data))
- with open(self._path, "w") as f:
+ with open(self._path, "wb") as f:
pickle.dump(self._data, f)
except (OSError, IOError) as e:
log.error("Error saving storage file '%s': %s" % (self._path, e))
def load(self):
try:
- with open(self._path, "r") as f:
+ with open(self._path, "rb") as f:
self._data = pickle.load(f)
except (OSError, IOError) as e:
log.debug("Error loading storage file '%s': %s" % (self._path, e))
--
1.8.3.1

View File

@ -1,35 +0,0 @@
From 2cc3d747986837d7e7957f5a4baede2dd691348a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>
Date: Thu, 24 Jan 2019 16:28:24 +0100
Subject: [PATCH 070/124] plugin_disk: Fix checking the 'removable' attribute
on python3
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The 'removable' attribute is a bytestring, so it will never be equal to
"0" in python3. Check equality with b"0" instead.
The patch was originally written by Tomáš Korbař.
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
---
tuned/plugins/plugin_disk.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tuned/plugins/plugin_disk.py b/tuned/plugins/plugin_disk.py
index 1de1257..65504d8 100644
--- a/tuned/plugins/plugin_disk.py
+++ b/tuned/plugins/plugin_disk.py
@@ -39,7 +39,7 @@ class DiskPlugin(hotplug.Plugin):
@classmethod
def _device_is_supported(cls, device):
return device.device_type == "disk" and \
- device.attributes.get("removable", None) == "0" and \
+ device.attributes.get("removable", None) == b"0" and \
(device.parent is None or \
device.parent.subsystem in ["scsi", "virtio", "xen"])
--
1.8.3.1

View File

@ -1,29 +0,0 @@
From a2219675f29fae94540868bf63f36f62c61b92c7 Mon Sep 17 00:00:00 2001
From: Tomas Korbar <tkorbar@redhat.com>
Date: Wed, 12 Dec 2018 14:48:09 +0100
Subject: [PATCH 074/124] fix disk plugin/plugout problem
when udev sends remove event it does not send any device
attributes with it so _device_is_supported check must be omitted
Resolves: rhbz#1595156
---
tuned/plugins/plugin_disk.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tuned/plugins/plugin_disk.py b/tuned/plugins/plugin_disk.py
index 1de1257..56e56f4 100644
--- a/tuned/plugins/plugin_disk.py
+++ b/tuned/plugins/plugin_disk.py
@@ -50,7 +50,7 @@ class DiskPlugin(hotplug.Plugin):
self._hardware_inventory.unsubscribe(self)
def _hardware_events_callback(self, event, device):
- if self._device_is_supported(device):
+ if self._device_is_supported(device) or event == "remove":
super(DiskPlugin, self)._hardware_events_callback(event, device)
def _added_device_apply_tuning(self, instance, device_name):
--
1.8.3.1

View File

@ -1,60 +0,0 @@
From 9e6913231d307590fd6a9bc024be549aaa2d8c5e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>
Date: Tue, 5 Mar 2019 10:31:42 +0100
Subject: [PATCH 099/124] Fix checking for None values
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In python, 'is None' should be used instead of '== None' to check if
something is None.
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
---
experiments/kwin-stop/xlib-example.py | 2 +-
tuned/plugins/plugin_systemd.py | 2 +-
tuned/profiles/merger.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/experiments/kwin-stop/xlib-example.py b/experiments/kwin-stop/xlib-example.py
index b8477a5..a0d6206 100644
--- a/experiments/kwin-stop/xlib-example.py
+++ b/experiments/kwin-stop/xlib-example.py
@@ -32,7 +32,7 @@ def loop():
root = dpy.screen(num).root
for win in root.get_full_property(dpy.get_atom('_NET_CLIENT_LIST'), 0).value.tolist():
window = dpy.create_resource_object('window', win)
- if window.get_full_property(dpy.get_atom('_NET_WM_STATE'), Xatom.WINDOW) == None:
+ if window.get_full_property(dpy.get_atom('_NET_WM_STATE'), Xatom.WINDOW) is None:
continue
if dpy.get_atom("_NET_WM_STATE_HIDDEN") in window.get_full_property(dpy.get_atom('_NET_WM_STATE'), 0).value.tolist():
if not win in hidden:
diff --git a/tuned/plugins/plugin_systemd.py b/tuned/plugins/plugin_systemd.py
index f6857c5..8f6bbc8 100644
--- a/tuned/plugins/plugin_systemd.py
+++ b/tuned/plugins/plugin_systemd.py
@@ -61,7 +61,7 @@ class SystemdPlugin(base.Plugin):
def _read_systemd_system_conf(self):
systemd_system_conf = self._cmd.read_file(consts.SYSTEMD_SYSTEM_CONF_FILE, err_ret = None)
- if systemd_system_conf == None:
+ if systemd_system_conf is None:
log.error("error reading systemd configuration file")
return None
return systemd_system_conf
diff --git a/tuned/profiles/merger.py b/tuned/profiles/merger.py
index 7a3e05c..2364543 100644
--- a/tuned/profiles/merger.py
+++ b/tuned/profiles/merger.py
@@ -33,7 +33,7 @@ class Merger(object):
profile_a.units[unit_name].type = unit.type
profile_a.units[unit_name].enabled = unit.enabled
profile_a.units[unit_name].devices = unit.devices
- if unit.devices_udev_regex != None:
+ if unit.devices_udev_regex is not None:
profile_a.units[unit_name].devices_udev_regex = unit.devices_udev_regex
if unit.script_pre is not None:
profile_a.units[unit_name].script_pre = unit.script_pre
--
1.8.3.1

View File

@ -1,34 +0,0 @@
From b4e975bef871c949e199952d4c3b84f73668f437 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= <jskarvad@redhat.com>
Date: Thu, 4 Mar 2021 21:14:54 +0100
Subject: [PATCH] powertop2tuned: work with PowerTOP 2.13 and newer
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes: #328
Referencehttps://github.com/redhat-performance/tuned/pull/329/commits/b4e975bef871c949e199952d4c3b84f73668f437
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
---
experiments/powertop2tuned.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/experiments/powertop2tuned.py b/experiments/powertop2tuned.py
index 211df2d3..8ab260cf 100755
--- a/experiments/powertop2tuned.py
+++ b/experiments/powertop2tuned.py
@@ -215,9 +215,12 @@ def generateHTML(self):
print('PowerTOP returned error code: %d' % proc.returncode, file=sys.stderr)
return -2
- prefix = "PowerTOP outputing using base filename "
+ prefix = "PowerTOP outputting using base filename "
if output.find(prefix) == -1:
- return -1
+ # workaround for PowerTOP older than 2.13
+ prefix = "PowerTOP outputing using base filename "
+ if output.find(prefix) == -1:
+ return -1
name = output[output.find(prefix)+len(prefix):-1]
#print "Parsed filename=", [name]

View File

@ -0,0 +1,26 @@
From 9045cc4a583ea644fa1ef8454e4c3d2c63a9d248 Mon Sep 17 00:00:00 2001
From: hongrongxuan <hongrongxuan@huawei.com>
Date: Mon, 26 Dec 2022 09:29:48 +0800
Subject: [PATCH] change the default percentage when dirty data starts
writeback
---
profiles/throughput-performance/tuned.conf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/profiles/throughput-performance/tuned.conf b/profiles/throughput-performance/tuned.conf
index 98c6b26..84ca25a 100644
--- a/profiles/throughput-performance/tuned.conf
+++ b/profiles/throughput-performance/tuned.conf
@@ -35,7 +35,7 @@ readahead=>4096
#
# The generator of dirty data starts writeback at this percentage (system default
# is 20%)
-vm.dirty_ratio = 40
+vm.dirty_ratio = 60
# Start background writeback (via writeback threads) at this percentage (system
# default is 10%)
--
2.27.0

View File

@ -1,45 +0,0 @@
From 43375e6bbe389606fbd24d0a84535285a1a8040c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>
Date: Thu, 17 Sep 2020 18:57:24 +0800
Subject: [PATCH] cpu: Update checking if EPB is supported
Update checking if EPB is supported so that it works with recent
versions of the x86_energy_perf_policy tool. Newer versions of
x86_energy_perf_policy, unlike older versions, exit with a zero exit
code even if the CPU doesn't support EPB. Newer versions of the tool
give no ouput on stdout if EPB is not supported, so check for that.
In the future, we might like to determine if EPB is supported by
searching /proc/cpuinfo for specific CPU flags. However the solution
described in the previous paragraph should work just fine for now.
Resolves: rhbz#1690929
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
https://github.com/redhat-performance/tuned/pull/217/commits/43375e6bbe389606fbd24d0a84535285a1a8040c
---
tuned/plugins/plugin_cpu.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tuned/plugins/plugin_cpu.py b/tuned/plugins/plugin_cpu.py
index 8f0babd..4934022 100644
--- a/tuned/plugins/plugin_cpu.py
+++ b/tuned/plugins/plugin_cpu.py
@@ -61,8 +61,11 @@ class CPULatencyPlugin(base.Plugin):
def _check_energy_perf_bias(self):
self._has_energy_perf_bias = False
retcode_unsupported = 1
- retcode = self._cmd.execute(["x86_energy_perf_policy", "-r"], no_errors = [errno.ENOENT, retcode_unsupported])[0]
- if retcode == 0:
+ retcode, out = self._cmd.execute(["x86_energy_perf_policy", "-r"], no_errors = [errno.ENOENT, retcode_unsupported])
+ # With recent versions of the tool, a zero exit code is
+ # returned even if EPB is not supported. The output is empty
+ # in that case, however.
+ if retcode == 0 and out != "":
self._has_energy_perf_bias = True
elif retcode < 0:
log.warning("unable to run x86_energy_perf_policy tool, ignoring CPU energy performance bias, is the tool installed?")
--
2.23.0

View File

@ -1,18 +0,0 @@
--- a/Makefile
+++ b/Makefile
@@ -30,12 +30,12 @@ VERSIONED_NAME = $(NAME)-$(VERSION)$(GIT_PSUFFIX)
SYSCONFDIR = /etc
DATADIR = /usr/share
DOCDIR = $(DATADIR)/doc/$(NAME)
-PYTHON = python3
+PYTHON = /usr/bin/python3
PYLINT = pylint-3
ifeq ($(PYTHON),python2)
PYLINT = pylint-2
endif
-SHEBANG_REWRITE_REGEX= '1s/^(\#!\/usr\/bin\/)\<python\>/\1$(PYTHON)/'
+SHEBANG_REWRITE_REGEX= '1s|^\#!/usr/bin/\<python\>|\#!$(PYTHON)|'
PYTHON_SITELIB = $(shell $(PYTHON) -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib());')
ifeq ($(PYTHON_SITELIB),)
$(error Failed to determine python library directory)

View File

@ -1,60 +0,0 @@
From f19b7c5713acb76a200811f6531acf2791505cac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= <jskarvad@redhat.com>
Date: Wed, 4 Jul 2018 23:27:38 +0200
Subject: [PATCH] Fixed compatibility with python-3.7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In python-3.7 async is a keyword, so it cannot be redefined.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
---
tuned-adm.py | 4 ++--
tuned/admin/admin.py | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tuned-adm.py b/tuned-adm.py
index ea85c54..1b9623d 100755
--- a/tuned-adm.py
+++ b/tuned-adm.py
@@ -98,7 +98,7 @@ if __name__ == "__main__":
options = vars(args)
debug = options.pop("debug")
- async = options.pop("async")
+ asynco = options.pop("async")
timeout = options.pop("timeout")
action_name = options.pop("action")
log_level = options.pop("loglevel")
@@ -107,7 +107,7 @@ if __name__ == "__main__":
dbus = config.get_bool(consts.CFG_DAEMON, consts.CFG_DEF_DAEMON)
try:
- admin = tuned.admin.Admin(dbus, debug, async, timeout, log_level)
+ admin = tuned.admin.Admin(dbus, debug, asynco, timeout, log_level)
result = admin.action(action_name, **options)
except:
diff --git a/tuned/admin/admin.py b/tuned/admin/admin.py
index 728af32..3f84413 100644
--- a/tuned/admin/admin.py
+++ b/tuned/admin/admin.py
@@ -14,12 +14,12 @@ import threading
import logging
class Admin(object):
- def __init__(self, dbus = True, debug = False, async = False,
+ def __init__(self, dbus = True, debug = False, asynco = False,
timeout = consts.ADMIN_TIMEOUT,
log_level = logging.ERROR):
self._dbus = dbus
self._debug = debug
- self._async = async
+ self._async = asynco
self._timeout = timeout
self._cmd = commands(debug)
self._profiles_locator = profiles_locator(consts.LOAD_DIRECTORIES)
--
2.14.4

Binary file not shown.

View File

@ -0,0 +1,83 @@
diff --git a/profiles/latency-performance/tuned.conf b/profiles/latency-performance/tuned.conf
index d200b5c..877229f 100644
--- a/profiles/latency-performance/tuned.conf
+++ b/profiles/latency-performance/tuned.conf
@@ -32,3 +32,16 @@ vm.dirty_background_ratio=3
# 100 tells the kernel to aggressively swap processes out of physical memory
# and move them to swap cache
vm.swappiness=10
+
+[scheduler]
+# ktune sysctl settings for rhel6 servers, maximizing i/o throughput
+#
+# Minimal preemption granularity for CPU-bound tasks:
+# (default: 1 msec# (1 + ilog(ncpus)), units: nanoseconds)
+sched_min_granularity_ns = 3000000
+sched_wakeup_granularity_ns = 4000000
+
+# The total time the scheduler will consider a migrated process
+# "cache hot" and thus less likely to be re-migrated
+# (system default is 500000, i.e. 0.5 ms)
+sched_migration_cost_ns = 5000000
diff --git a/profiles/sap-hana/tuned.conf b/profiles/sap-hana/tuned.conf
index aeecf53..8dcee57 100644
--- a/profiles/sap-hana/tuned.conf
+++ b/profiles/sap-hana/tuned.conf
@@ -20,3 +20,7 @@ kernel.numa_balancing = 0
vm.dirty_ratio = 40
vm.dirty_background_ratio = 10
vm.swappiness = 10
+
+[scheduler]
+sched_min_granularity_ns = 3000000
+sched_wakeup_granularity_ns = 4000000
diff --git a/profiles/throughput-performance/tuned.conf b/profiles/throughput-performance/tuned.conf
index 98c6b26..ebb3f7d 100644
--- a/profiles/throughput-performance/tuned.conf
+++ b/profiles/throughput-performance/tuned.conf
@@ -58,9 +58,31 @@ vm.dirty_background_ratio = 10
# and move them to swap cache
vm.swappiness=10
+[scheduler]
+# ktune sysctl settings for rhel6 servers, maximizing i/o throughput
+#
+# Minimal preemption granularity for CPU-bound tasks:
+# (default: 1 msec# (1 + ilog(ncpus)), units: nanoseconds)
+sched_min_granularity_ns = 10000000
+
+# SCHED_OTHER wake-up granularity.
+# (default: 1 msec# (1 + ilog(ncpus)), units: nanoseconds)
+#
+# This option delays the preemption effects of decoupled workloads
+# and reduces their over-scheduling. Synchronous workloads will still
+# have immediate wakeup/sleep latencies.
+sched_wakeup_granularity_ns = 15000000
+
# Marvell ThunderX
[sysctl.thunderx]
type=sysctl
uname_regex=aarch64
cpuinfo_regex=${thunderx_cpuinfo_regex}
kernel.numa_balancing=0
+
+# AMD
+[scheduler.amd]
+type=scheduler
+uname_regex=x86_64
+cpuinfo_regex=${amd_cpuinfo_regex}
+sched_migration_cost_ns=5000000
diff --git a/profiles/virtual-host/tuned.conf b/profiles/virtual-host/tuned.conf
index 5301d9f..74a5fb0 100644
--- a/profiles/virtual-host/tuned.conf
+++ b/profiles/virtual-host/tuned.conf
@@ -14,3 +14,9 @@ vm.dirty_background_ratio = 5
[cpu]
# Setting C3 state sleep mode/power savings
force_latency=cstate.id_no_zero:3|70
+
+[scheduler]
+# The total time the scheduler will consider a migrated process
+# "cache hot" and thus less likely to be re-migrated
+# (system default is 500000, i.e. 0.5 ms)
+sched_migration_cost_ns = 5000000

View File

@ -0,0 +1,80 @@
diff --git a/profiles/cpu-partitioning/script.sh b/profiles/cpu-partitioning/script.sh
index 84e04fd..8677050 100755
--- a/profiles/cpu-partitioning/script.sh
+++ b/profiles/cpu-partitioning/script.sh
@@ -2,6 +2,38 @@
. /usr/lib/tuned/functions
+no_balance_cpus_file=$STORAGE/no-balance-cpus.txt
+
+change_sd_balance_bit()
+{
+ local set_bit=$1
+ local flags_cur=
+ local file=
+ local cpu=
+
+ for cpu in $(cat $no_balance_cpus_file); do
+ for file in $(find /proc/sys/kernel/sched_domain/cpu$cpu -name flags -print); do
+ flags_cur=$(cat $file)
+ if [ $set_bit -eq 1 ]; then
+ flags_cur=$((flags_cur | 0x1))
+ else
+ flags_cur=$((flags_cur & 0xfffe))
+ fi
+ echo $flags_cur > $file
+ done
+ done
+}
+
+disable_balance_domains()
+{
+ change_sd_balance_bit 0
+}
+
+enable_balance_domains()
+{
+ change_sd_balance_bit 1
+}
+
start() {
mkdir -p "${TUNED_tmpdir}/etc/systemd"
mkdir -p "${TUNED_tmpdir}/usr/lib/dracut/hooks/pre-udev"
@@ -9,6 +41,9 @@ start() {
cp 00-tuned-pre-udev.sh "${TUNED_tmpdir}/usr/lib/dracut/hooks/pre-udev/"
setup_kvm_mod_low_latency
disable_ksm
+
+ echo "$TUNED_no_balance_cores_expanded" | sed 's/,/ /g' > $no_balance_cpus_file
+ disable_balance_domains
return "$?"
}
@@ -18,6 +53,7 @@ stop() {
teardown_kvm_mod_low_latency
enable_ksm
fi
+ enable_balance_domains
return "$?"
}
diff --git a/profiles/cpu-partitioning/tuned.conf b/profiles/cpu-partitioning/tuned.conf
index 979e40b..842e2bd 100644
--- a/profiles/cpu-partitioning/tuned.conf
+++ b/profiles/cpu-partitioning/tuned.conf
@@ -35,8 +35,6 @@ no_balance_cores_expanded=${f:cpulist_unpack:${no_balance_cores}}
# 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}}
-cmd_isolcpus=${f:regex_search_ternary:${no_balance_cores}:\s*[0-9]: isolcpus=${no_balance_cores}:}
-
[sysctl]
kernel.hung_task_timeout_secs = 600
kernel.nmi_watchdog = 0
@@ -68,4 +66,4 @@ priority=10
initrd_remove_dir=True
initrd_dst_img=tuned-initrd.img
initrd_add_dir=${tmpdir}
-cmdline_cpu_part=+nohz=on${cmd_isolcpus} nohz_full=${isolated_cores} rcu_nocbs=${isolated_cores} tuned.non_isolcpus=${not_isolated_cpumask} intel_pstate=disable nosoftlockup
+cmdline_cpu_part=+nohz=on nohz_full=${isolated_cores} rcu_nocbs=${isolated_cores} tuned.non_isolcpus=${not_isolated_cpumask} intel_pstate=disable nosoftlockup

BIN
tuned-2.19.0.tar.gz Normal file

Binary file not shown.

View File

@ -1,7 +1,7 @@
Summary: A system tuning service for Linux
Name: tuned
Version: 2.10.0
Release: 9
Version: 2.19.0
Release: 3
License: GPLv2+
Source0: https://github.com/redhat-performance/%{name}/archive/v%{version}%{?prerel2}.tar.gz#/%{name}-%{version}%{?prerel2}.tar.gz
URL: http://www.tuned-project.org/
@ -16,7 +16,7 @@ Requires(post): systemd, virt-what
Requires(preun): systemd
Requires(postun): systemd
BuildRequires: %{_py}, %{_py}-devel
BuildRequires: git, systemd, desktop-file-utils
BuildRequires: systemd, desktop-file-utils
Requires: python3-dbus, util-linux, systemtap
Requires: virt-what, gawk, dbus, ethtool
@ -27,21 +27,13 @@ Requires: %{_py}-schedutils, %{_py}-decorator, %{_py}-perf
Recommends:kernel-tools
Recommends:tuned-profiles-nfv-host-bin
Patch0: tuned-2.10.0-python-3.7-fix.patch
Patch1: 0001-tuned-adm-Fix-a-traceback-when-run-without-action-sp.patch
Patch2: tuned-2.10.0-makefile-full-python-path.patch
Patch3: 0001-tuned-gui-Sort-plugins-based-on-their-name.patch
Patch4: fix-cpu-Update-checking-if-EPB-is-supported.patch
Patch5: backport-powertop2tuned-work-with-PowerTOP-2.13-and-newer.patch
Patch9000: bugfix-tuned-2.8.0-restart-after-kill-dbus.patch
Patch9001: 0005-realtime-virtual-host-pin-only-the-vcpu-thread-to-is.patch
Patch9002: 0029-Fix-TypeError.patch
Patch9003: 0040-Fix-pickle-provider.patch
Patch9004: 0070-plugin_disk-Fix-checking-the-removable-attribute-on-.patch
Patch9005: 0074-fix-disk-plugin-plugout-problem.patch
Patch9006: 0099-Fix-checking-for-None-values.patch
Patch0: bugfix-tuned-2.8.0-restart-after-kill-dbus.patch
#the below two patches is from
#http://ftp.iij.ad.jp/pub/linux/centos-vault/centos/8-stream/BaseOS/Source/SPackages/tuned-2.19.0-1.el8.src.rpm
#this is used to compatible with old tuned version like 2.10
Patch1: tuned-2.18.0-rhel-8-profiles.patch
Patch2: tuned-2.18.0-sd-load-balance.patch
Patch3: change-the-default-percentage-when-dirty-data-starts.patch
Provides: tuned-gtk
Provides: tuned-utils
@ -156,7 +148,7 @@ Man pages and other related documents for %{name}
%prep
%autosetup -n %{name}-%{version} -p1 -Sgit
%autosetup -n %{name}-%{version} -p1
%build
@ -241,7 +233,6 @@ fi
%{_datadir}/%{name}/grub2
%{_datadir}/polkit-1/actions/com.redhat.%{name}.policy
%{_datadir}/%{name}/ui
%{_datadir}/polkit-1/actions/com.redhat.%{name}.gui.policy
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/applications/%{name}-gui.desktop
%{_sbindir}/%{name}
@ -258,7 +249,6 @@ fi
%{_prefix}/lib/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/cpu-partitioning-variables.conf
%config(noreplace) %{_sysconfdir}/%{name}/sap-hana-vmware-variables.conf
%config(noreplace) %{_sysconfdir}/%{name}/%{name}-main.conf
%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/active_profile
%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/profile_mode
@ -300,12 +290,29 @@ fi
%{_mandir}/man7/%{name}-profiles-realtime.7*
%{_mandir}/man7/%{name}-profiles-nfv-guest.7*
%{_mandir}/man7/%{name}-profiles-nfv-host.7*
%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/tuned/post_loaded_profile
%{_prefix}/lib/kernel/install.d/92-tuned.install
%{_mandir}/man7/tuned-profiles-openshift.7*
%{_mandir}/man7/tuned-profiles-postgresql.7*
%{_mandir}/man7/tuned-profiles-spectrumscale-ece.7*
%changelog
* Mon Dec 26 2022 hongrongxuan <hongrongxuan@huawei.com> - 2.19.0-3
- change the default percentage when dirty data starts writeback
* Tue Nov 8 2022 Qingqing Li <liqingqing3@huawei.com> - 2.19.0-2
- backport some patches to compatible with version 2.10
* Fri Sep 23 2022 langfei <langfei@huawei.com> - 2.19.0-1
- upgrade to 2.19.0
* Fri Jul 30 2021 chenyanpanHW <chenyanpan@huawei.com> - 2.10.0-10
- DESC: delete -Sgit from %autosetup, and delete BuildRequires git
* Fri Mar 05 2020 xinghe <xinghe1@huawei.com> - 2.10.0-9
- powertop2tuned work with PowerTOP 2.13 and newer
* Fri Sep 18 2020 xinghe <xinghe1@huawei.com> - 2.10.0-8
* Fri Sep 18 2021 xinghe <xinghe1@huawei.com> - 2.10.0-8
- cpu Update checking if EPB is supported
* Sun Sep 7 2019 hejingxian<hejingxian@huawei.com> - 2.10.0-7