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(a)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
Show replies by date
If a python file that does import tuna, is run with a main section, it
will fail with the relative imports in tuna.py
from . import help
ImportError: attempted relative import with no known parent package
Fix this by with a non-relative style import.
This will also work with an installed version of tuna, but when running
from source in git it will require the user to add the tuna dir to the
PYTHONPATH as well as the base directory
Signed-off-by: John Kacur <jkacur(a)redhat.com>
---
tuna/tuna.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tuna/tuna.py b/tuna/tuna.py
index f25eb3d10923..6b6edcc8ff72 100755
--- a/tuna/tuna.py
+++ b/tuna/tuna.py
@@ -12,8 +12,8 @@ import platform
import ethtool
import procfs
from procfs import utilist
-from . import help
-import tuna.tuna_sched as tuna_sched
+import help
+import tuna_sched
try:
fntable
--
2.31.1