tuna.spec: Add fix to print warning if setaffinity causes EBUSY

Add upstream patch to print warning if setaffinity caues EBUSY

Resolves: rhbz#2016540
Signed-off-by: John Kacur <jkacur@redhat.com>
This commit is contained in:
John Kacur 2021-10-28 12:54:39 -04:00
parent 3e95066e50
commit 4b00d65e8b
2 changed files with 47 additions and 1 deletions

View File

@ -0,0 +1,40 @@
From 1dd72d9db74b063c8dd96f13701a14e299abc325 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
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 <jkacur@redhat.com>
---
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

View File

@ -1,6 +1,6 @@
Name: tuna
Version: 0.16
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2
Summary: Application tuning GUI & command line utility
URL: https://git.kernel.org/pub/scm/utils/tuna/tuna.git
@ -14,6 +14,7 @@ Requires: python3-linux-procfs >= 0.6
# Requires: python-inet_diag
# Patches
Patch1: tuna-Print-warning-if-setting-affinity-results-in-EBUSY.patch
%description
Provides interface for changing scheduler and IRQ tunables, at whole CPU and at
@ -26,6 +27,7 @@ installed.
%prep
%setup -q
%patch1 -p1
%build
%py3_build
@ -67,6 +69,10 @@ done
%{_datadir}/polkit-1/actions/org.tuna.policy
%changelog
* Thu Oct 28 2021 John Kacur <jkacur@redhat.com> - 0.16-3
- Print warning if setaffinity causes EBUSY and continue
Resolves: rhbz#2016540
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 0.16-2
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688