When you attempt to move a thread that cannot be moved, schedutils.sched_setaffinity() throws an EINVAL OSError exception. tuna does not capture this, so the command exits with a Python traceback instead of an error message.
eg:
tuna --cpus=0 --threads=migration/1 --move Traceback (most recent call last): File "/bin/tuna", line 656, in <module> main() File "/bin/tuna", line 572, in main spread = spread) File "/usr/lib/python2.7/site-packages/tuna/tuna.py", line 265, in move_threads_to_cpu raise e OSError: [Errno 22] Invalid argument
This change handles that situation and exits more gracefully with an error message like this
tuna --cpus=0 --threads=migration/1 --move Cannot move thread
Reported-by: Guy Streeter streeter@redhat.com Signed-off-by: John Kacur jkacur@redhat.com
(see attachment for actual patch)
tuna-devel@lists.fedorahosted.org