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

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