diff --git a/tuna-Print-warning-if-setting-affinity-results-in-EBUSY.patch b/tuna-Print-warning-if-setting-affinity-results-in-EBUSY.patch new file mode 100644 index 0000000..1f3c408 --- /dev/null +++ b/tuna-Print-warning-if-setting-affinity-results-in-EBUSY.patch @@ -0,0 +1,40 @@ +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/tuna.spec b/tuna.spec index 2bbb9a2..648874e 100644 --- a/tuna.spec +++ b/tuna.spec @@ -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 - 0.16-3 +- Print warning if setaffinity causes EBUSY and continue +Resolves: rhbz#2016540 + * Tue Aug 10 2021 Mohan Boddu - 0.16-2 - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags Related: rhbz#1991688