Blame SOURCES/tuna-Print-warning-if-setting-affinity-results-in-EBUSY.patch

27e2ce
From 1dd72d9db74b063c8dd96f13701a14e299abc325 Mon Sep 17 00:00:00 2001
27e2ce
From: John Kacur <jkacur@redhat.com>
27e2ce
Date: Thu, 28 Oct 2021 00:50:12 -0400
27e2ce
Subject: [PATCH 1/2] tuna: Print warning if setting affinity results in EBUSY
27e2ce
 and continue
27e2ce
27e2ce
When trying to isolate a CPU, if a device uses SCHED_DEADLINE and admission
27e2ce
control is enabled, setting the affinity will result in the error EBUSY.
27e2ce
27e2ce
tuna should print a warning that this pid could not be moved, and
27e2ce
continue.
27e2ce
27e2ce
The user can either ignore the warning or use other measures to isolate
27e2ce
the cpu such as booting with isolcpus or turning off admission control
27e2ce
and rerunning the tuna isolate command and then turning admission
27e2ce
control back on.
27e2ce
27e2ce
Signed-off-by: John Kacur <jkacur@redhat.com>
27e2ce
---
27e2ce
 tuna/tuna.py | 4 ++++
27e2ce
 1 file changed, 4 insertions(+)
27e2ce
27e2ce
diff --git a/tuna/tuna.py b/tuna/tuna.py
27e2ce
index 591206d9b4e1..f25eb3d10923 100755
27e2ce
--- a/tuna/tuna.py
27e2ce
+++ b/tuna/tuna.py
27e2ce
@@ -360,6 +360,10 @@ def isolate_cpus(cpus, nr_cpus):
27e2ce
                 if err.args[0] == errno.EINVAL:
27e2ce
                     print("Function:", fname, ",", err.strerror, file=sys.stderr)
27e2ce
                     sys.exit(2)
27e2ce
+                if err.args[0] == errno.EBUSY:
27e2ce
+                    comm = ps[pid].stat["comm"]
27e2ce
+                    print(f'Warning: Unable to isolate pid {pid} [{comm}]')
27e2ce
+                    continue
27e2ce
                 raise err
27e2ce
 
27e2ce
         if "threads" not in ps[pid]:
27e2ce
-- 
27e2ce
2.31.1
27e2ce