diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2008-08-09 10:53:32 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2008-08-09 10:53:32 -0300 |
commit | d32bda825fd147d69cf37c02401b2fe15999a232 (patch) | |
tree | 888bd43194c8ff7e6482b55042532269af7301c7 | |
parent | b12a8e865ba9f2aa1f41bbd457eb1672b5d1d39d (diff) | |
download | tuna-d32bda825fd147d69cf37c02401b2fe15999a232.tar.gz |
tuna: Ignore rtprio when changing sched policy to SCHED_OTHER
When the user changes the sched policy to SCHED_OTHER the rtprio entry is
grayed, later, when thread_set_attributes is called it was trying to set
SCHED_OTHER with the previous, SCHED_RR/FIFO rtprio.
That, of course doesn't works, so fix it by setting the rtprio to 0 when
changing to SCHED_OTHER.
Thanks to Jon Masters for pointing out this annoying problem that required that
first the user set the rtprio to 0, then the policy to OTHER and then hit OK to
have it working.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tuna/tuna_gui.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tuna/tuna_gui.py b/tuna/tuna_gui.py index d1da3e2..2bad7cd 100644 --- a/tuna/tuna_gui.py +++ b/tuna/tuna_gui.py @@ -308,6 +308,8 @@ def thread_set_attributes(pid, threads, new_policy, new_prio, new_affinity, nr_c changed = False curr_policy = schedutils.get_scheduler(pid) curr_prio = int(threads[pid]["stat"]["rt_priority"]) + if new_policy == SCHED_OTHER: + new_prio = 0 if curr_policy != new_policy or curr_prio != new_prio: try: schedutils.set_scheduler(pid, new_policy, new_prio) |