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