[PATCH 2/3] tuna: Fix run command failing to apply BATCH policy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When using tuna run with -p BATCH the newly spawned process is created
with SCHED_OTHER instead of SCHED_BATCH

Fix this by calling thread_set_priority if the policy is not zero

Signed-off-by: John Kacur <jkacur@xxxxxxxxxx>
---
 tuna/tuna.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tuna/tuna.py b/tuna/tuna.py
index d4c3e2c1a661..1380df0dadba 100755
--- a/tuna/tuna.py
+++ b/tuna/tuna.py
@@ -621,7 +621,7 @@ def run_command(cmd, policy, rtprio, cpu_list, background):
     if newpid == 0:
         cmd_list = shlex.split(cmd)
         pid = os.getpid()
-        if rtprio:
+        if rtprio or policy:
             try:
                 thread_set_priority(pid, policy, rtprio)
             except (SystemError, OSError) as err:
-- 
2.49.0





[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux