I have a long running process on a server running Ubuntu Server 9.10. I would like to make it run under the SCHED_IDLE policy using the chrt
command. However, after reading the man page, I can't manage to understand the proper way to issue the command for a running process.
I've tried unsuccessfully:
# chrt -i -p 688
pid 688's current scheduling policy: SCHED_OTHER
pid 688's current scheduling priority: 0
# chrt -p -i 688
pid 688's current scheduling policy: SCHED_OTHER
pid 688's current scheduling priority: 0
# chrt -p 688 -i
chrt: failed to set pid 0's policy: Invalid argument
I'll keep trying, but do you know how to do what I want?
Wow. After checking the web for examples, I found this page at ibm.com, which gives an example how to set the scheduling policy of a running process to SCHED_FIFO:
35, obviously, being the priority of the process in the SCHED_FIFO policy. So I just tried to use a dummy 0 priority:
and was successful.