From dd1a54f7cbfea49a827aedb9900de4e36824b08a Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Wed, 19 Jan 2022 21:25:47 +0000 Subject: [PATCH] import tuna-0.17-1.el8 --- .gitignore | 2 +- .tuna.metadata | 2 +- ...tion-between-spread-and-move-to-erro.patch | 49 --------------- SOURCES/tuna-Fix-ModuleNotFoundError.patch | 35 +++++++++++ ...splays-incorrect-cpu-affinity-when-c.patch | 61 ------------------- ...hat-include-and-isolate-affects-IRQs.patch | 55 ----------------- ...if-setting-affinity-results-in-EBUSY.patch | 40 ------------ SPECS/tuna.spec | 17 +++--- 8 files changed, 45 insertions(+), 216 deletions(-) delete mode 100644 SOURCES/tuna-Add-distinction-between-spread-and-move-to-erro.patch create mode 100644 SOURCES/tuna-Fix-ModuleNotFoundError.patch delete mode 100644 SOURCES/tuna-Fix-tuna-displays-incorrect-cpu-affinity-when-c.patch delete mode 100644 SOURCES/tuna-Make-it-clear-that-include-and-isolate-affects-IRQs.patch delete mode 100644 SOURCES/tuna-Print-warning-if-setting-affinity-results-in-EBUSY.patch diff --git a/.gitignore b/.gitignore index 359611c..99fe941 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/tuna-0.16.tar.xz +SOURCES/tuna-0.17.tar.xz diff --git a/.tuna.metadata b/.tuna.metadata index d0a8076..88e8cd7 100644 --- a/.tuna.metadata +++ b/.tuna.metadata @@ -1 +1 @@ -634c59ed06f7e638412e0e4832cf811c432a767b SOURCES/tuna-0.16.tar.xz +9bde1e92e09277efcb13ee5808baa1632ae815cb SOURCES/tuna-0.17.tar.xz diff --git a/SOURCES/tuna-Add-distinction-between-spread-and-move-to-erro.patch b/SOURCES/tuna-Add-distinction-between-spread-and-move-to-erro.patch deleted file mode 100644 index da88748..0000000 --- a/SOURCES/tuna-Add-distinction-between-spread-and-move-to-erro.patch +++ /dev/null @@ -1,49 +0,0 @@ -From c9d2fc624905cd0af96ee9f84317d562a042fe14 Mon Sep 17 00:00:00 2001 -From: Leah Leshchinsky -Date: Wed, 6 Oct 2021 13:21:50 -0400 -Subject: [PATCH] tuna: Add distinction between --spread and --move to error - message - -Currently, the command `tuna --cpus=CPU-LIST --spread` generates an -error with the warning "tuna: --move requires a list of threads/irqs!". -Similarly, when the command `tuna --threads=THREAD-LIST --spread` is -run, it generates the warning "tuna: --move requires a cpu list!". - -This can be confusing to the user, especially with commands that use both -the "--spread" and "--move" flags. The warning should specify "--spread" -when that is the source of the error. - -Check whether the argument is a move or spread and update the warning -string accordingly. - -Signed-off-by: Leah Leshchinsky ---- - tuna-cmd.py | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - -diff --git a/tuna-cmd.py b/tuna-cmd.py -index 8617966..8dfad9e 100755 ---- a/tuna-cmd.py -+++ b/tuna-cmd.py -@@ -633,15 +633,14 @@ def main(): - elif o in ("-n", "--show_sockets"): - show_sockets = True - elif o in ("-m", "--move", "-x", "--spread"): -+ spread = o in ("-x", "--spread") - if not cpu_list: -- print("tuna: --move " + _("requires a cpu list!")) -+ print("tuna: %s " % ("--spread" if spread else "--move") + _("requires a cpu list!")) - sys.exit(2) - if not (thread_list or irq_list): -- print("tuna: --move " + _("requires a list of threads/irqs!")) -+ print("tuna: %s " % ("--spread" if spread else "--move") + _("requires a list of threads/irqs!")) - sys.exit(2) - -- spread = o in ("-x", "--spread") -- - if thread_list: - tuna.move_threads_to_cpu(cpu_list, thread_list, spread=spread) - --- -2.27.0 - diff --git a/SOURCES/tuna-Fix-ModuleNotFoundError.patch b/SOURCES/tuna-Fix-ModuleNotFoundError.patch new file mode 100644 index 0000000..7b5cc20 --- /dev/null +++ b/SOURCES/tuna-Fix-ModuleNotFoundError.patch @@ -0,0 +1,35 @@ +From 7684169d22af5379d2f466730c450afc92e80da8 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Tue, 11 Jan 2022 16:58:58 -0500 +Subject: [PATCH] tuna: Fix ModuleNotFoundError + +commit 43b434867514934593ada5aa8ea448ef6a1778f9 fixed the problem with +relative imports but unfortunately created a new problem with installed +tuna + +This fixes the original problem and also fixes the ModuleNotFoundError +in an installed (not running from git) version of tuna. + +Signed-off-by: John Kacur +--- + tuna/tuna.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tuna/tuna.py b/tuna/tuna.py +index 98a1725598dd..8fb42121e2e4 100755 +--- a/tuna/tuna.py ++++ b/tuna/tuna.py +@@ -12,8 +12,8 @@ import platform + import ethtool + import procfs + from procfs import utilist +-import help +-import tuna_sched ++from tuna import help ++from tuna import tuna_sched + + try: + fntable +-- +2.27.0 + diff --git a/SOURCES/tuna-Fix-tuna-displays-incorrect-cpu-affinity-when-c.patch b/SOURCES/tuna-Fix-tuna-displays-incorrect-cpu-affinity-when-c.patch deleted file mode 100644 index d2a04eb..0000000 --- a/SOURCES/tuna-Fix-tuna-displays-incorrect-cpu-affinity-when-c.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 6e43ce523e7b403cc4f5e94c988d8811d2053e0f Mon Sep 17 00:00:00 2001 -From: John Kacur -Date: Tue, 14 Dec 2021 14:59:50 -0500 -Subject: [PATCH] tuna: Fix tuna displays incorrect cpu affinity when cpu is - offlined - -If we create a process and query it's affinity, both taskset and tuna -display the same result, but if we then disable a processor, tuna -displays the wrong affinity, as below. - -[jkacur@fionn tuna]$ sha1sum /dev/zero & -[1] 10640 -[jkacur@fionn tuna]$ taskset -p 10640 -pid 10640's current affinity mask: fff -[jkacur@fionn tuna]$ su -c './tuna-cmd.py -t sha1sum -P' -Password: - thread ctxt_switches - pid SCHED_ rtpri affinity voluntary nonvoluntary cmd - 10640 OTHER 0 0xfff 0 423 sha1sum -[jkacur@fionn tuna]$ su -c 'chcpu -d 5' -Password: -CPU 5 disabled -[jkacur@fionn tuna]$ taskset -p 10640 -pid 10640's current affinity mask: fdf -[jkacur@fionn tuna]$ su -c './tuna-cmd.py -t sha1sum -P' -Password: - thread ctxt_switches - pid SCHED_ rtpri affinity voluntary nonvoluntary cmd - 10640 OTHER 0 0x7df 0 919 sha1sum - -The reason for this is that after tuna gets the affinity for the -process, when it converts this to a hex value, it passes the number of -enabled processors to hexbitmask in procfs, when what we really need is -the number of processors including disabled ones. - -Fix this by querrying SC_NPROCESSORS_CONF and passing that value to -hexbitmask. - -Signed-off-by: John Kacur ---- - tuna-cmd.py | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/tuna-cmd.py b/tuna-cmd.py -index d209a2e89493..7e33a128d676 100755 ---- a/tuna-cmd.py -+++ b/tuna-cmd.py -@@ -199,7 +199,9 @@ def format_affinity(affinity): - if len(affinity) <= 4: - return ",".join(str(a) for a in affinity) - -- return ",".join(str(hex(a)) for a in procfs.hexbitmask(affinity, get_nr_cpus())) -+ # We need the number of cpus on a system, including disabled ones -+ ncpus = os.sysconf('SC_NPROCESSORS_CONF') -+ return ",".join(str(hex(a)) for a in procfs.hexbitmask(affinity, ncpus)) - - - def ps_show_thread(pid, affect_children, ps, has_ctxt_switch_info, sock_inodes, --- -2.31.1 - diff --git a/SOURCES/tuna-Make-it-clear-that-include-and-isolate-affects-IRQs.patch b/SOURCES/tuna-Make-it-clear-that-include-and-isolate-affects-IRQs.patch deleted file mode 100644 index e983ecc..0000000 --- a/SOURCES/tuna-Make-it-clear-that-include-and-isolate-affects-IRQs.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 532739e58bc36df820a1742489c744e7589221d0 Mon Sep 17 00:00:00 2001 -From: John Kacur -Date: Wed, 10 Nov 2021 15:58:44 -0500 -Subject: [PATCH] tuna: Make it clear that include and isolate affects IRQs in - help - -Make it clear in the online help (-h) and in the manpage -that --i --isolate --I --include - -affects IRQs as well as threads - -Signed-off-by: John Kacur ---- - docs/tuna.8 | 4 ++-- - tuna-cmd.py | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/docs/tuna.8 b/docs/tuna.8 -index b6431be5e117..bd6299b5a771 100644 ---- a/docs/tuna.8 -+++ b/docs/tuna.8 -@@ -26,10 +26,10 @@ Apply changes described in profile - List preloaded profiles - .TP - \fB\-i\fR, \fB\-\-isolate\fR --Move all threads away from CPU\-LIST. Requires \fB\-c\fR or \fB-S\fR. -+Move all allowed threads and IRQs away from CPU\-LIST. Requires \fB\-c\fR or \fB-S\fR. - .TP - \fB\-I\fR, \fB\-\-include\fR --Allow all threads to run on CPU\-LIST. Requires \fB\-c\fR or \fB-S\fR. -+Allow all allowed threads and IRQs to run on CPU\-LIST. Requires \fB\-c\fR or \fB-S\fR. - .TP - \fB\-m\fR, \fB\-\-move\fR - Move selected entities to CPU\-LIST. Requires \fB\-c\fR and either \fB-t\fR or \fB-q\fR. -diff --git a/tuna-cmd.py b/tuna-cmd.py -index 46ce86efa036..d209a2e89493 100755 ---- a/tuna-cmd.py -+++ b/tuna-cmd.py -@@ -63,9 +63,9 @@ def usage(): - _('Explicitly disable usage of perf in GUI for process view'))) - print(fmt % ('-f, --filter', - _('Display filter the selected entities'))) -- print(fmt % ('-i, --isolate', _('Move all threads away from %(cpulist)s') % -+ print(fmt % ('-i, --isolate', _('Move all allowed threads and IRQs away from %(cpulist)s') % - {"cpulist": _('CPU-LIST')})) -- print(fmt % ('-I, --include', _('Allow all threads to run on %(cpulist)s') % -+ print(fmt % ('-I, --include', _('Allow all allowed threads and IRQs to run on %(cpulist)s') % - {"cpulist": _('CPU-LIST')})) - print(fmt % ('-K, --no_kthreads', - _('Operations will not affect kernel threads'))) --- -2.31.1 - diff --git a/SOURCES/tuna-Print-warning-if-setting-affinity-results-in-EBUSY.patch b/SOURCES/tuna-Print-warning-if-setting-affinity-results-in-EBUSY.patch deleted file mode 100644 index 1f3c408..0000000 --- a/SOURCES/tuna-Print-warning-if-setting-affinity-results-in-EBUSY.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 1dd72d9db74b063c8dd96f13701a14e299abc325 Mon Sep 17 00:00:00 2001 -From: John Kacur -Date: Thu, 28 Oct 2021 00:50:12 -0400 -Subject: [PATCH 1/2] tuna: Print warning if setting affinity results in EBUSY - and continue - -When trying to isolate a CPU, if a device uses SCHED_DEADLINE and admission -control is enabled, setting the affinity will result in the error EBUSY. - -tuna should print a warning that this pid could not be moved, and -continue. - -The user can either ignore the warning or use other measures to isolate -the cpu such as booting with isolcpus or turning off admission control -and rerunning the tuna isolate command and then turning admission -control back on. - -Signed-off-by: John Kacur ---- - tuna/tuna.py | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/tuna/tuna.py b/tuna/tuna.py -index 591206d9b4e1..f25eb3d10923 100755 ---- a/tuna/tuna.py -+++ b/tuna/tuna.py -@@ -360,6 +360,10 @@ def isolate_cpus(cpus, nr_cpus): - if err.args[0] == errno.EINVAL: - print("Function:", fname, ",", err.strerror, file=sys.stderr) - sys.exit(2) -+ if err.args[0] == errno.EBUSY: -+ comm = ps[pid].stat["comm"] -+ print(f'Warning: Unable to isolate pid {pid} [{comm}]') -+ continue - raise err - - if "threads" not in ps[pid]: --- -2.31.1 - diff --git a/SPECS/tuna.spec b/SPECS/tuna.spec index e9751be..72b6bb6 100644 --- a/SPECS/tuna.spec +++ b/SPECS/tuna.spec @@ -1,6 +1,6 @@ Name: tuna -Version: 0.16 -Release: 5%{?dist} +Version: 0.17 +Release: 1%{?dist} License: GPLv2 Summary: Application tuning GUI & command line utility Group: Applications/System @@ -16,10 +16,7 @@ Requires: python3-linux-procfs >= 0.6 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) # PATCHES -Patch1: tuna-Add-distinction-between-spread-and-move-to-erro.patch -Patch2: tuna-Print-warning-if-setting-affinity-results-in-EBUSY.patch -Patch3: tuna-Make-it-clear-that-include-and-isolate-affects-IRQs.patch -Patch4: tuna-Fix-tuna-displays-incorrect-cpu-affinity-when-c.patch +Patch1: tuna-Fix-ModuleNotFoundError.patch %description Provides interface for changing scheduler and IRQ tunables, at whole CPU and at @@ -33,9 +30,6 @@ installed. %prep %setup -q %patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 %build %{__python3} setup.py build @@ -82,6 +76,11 @@ rm -rf %{buildroot} %{_datadir}/polkit-1/actions/org.tuna.policy %changelog +* Thu Jan 13 2022 Leah Leshchinsky - 0.17-1 +- Rebase to upstream version 0.17 +- Fix ModuleNotFoundError +Resolves: rhbz#2012306 + * Tue Dec 14 2021 John Kacur - 0.16-5 - Display correct cpu-affinity when a cpu is disabled Resolves: rhbz#2032614