0

While working on an embedded project; during changing of the scheduling policy from SCHED_OTHER to SCHED_RR I am getting timer issues and stream loading delays. Some issues are not coming during SCHED_OTHER but arriving at SCHED_RR(round robin).

What effect will occur while changing the scheduling policies. What do I need to take care of when implementing kernel module in embedded projects during policy changes?

AlG
  • 14,697
  • 4
  • 41
  • 54
Gughan
  • 23
  • 2

1 Answers1

0

SCHED_RR is with a time slice so if the process completes the time slice the next process will be on turn. If you your time slice is big enough the short IO Processes will get a disadvantage over the Cpu, because the cpu task blocks the CPU for the complete time slice. But care if you reduce the time slice you will get more context switches and so less performance for this higher responsibility. I also provides Priorities.

SCHED_OTHER is not like RR and so don't provide static priorities. It has one dynamic priority which will increase if the process is ready to run but in the waiting queue. Its will be reset to 0 if the process becomes active. You also can scale the dynamic value with nice from -20 to 19 (on 19 the process is nice and waits more often)

I mostly used SCHED_OTHER and SCHED_FIFO in embedded systems

best regards Kenny

phschoen
  • 2,021
  • 16
  • 25
  • Thank you kenny for providing the input. – Gughan Feb 17 '12 at 08:36
  • But in this regarding that time slicing how to reduce the time slice for the process, is there any posix function for that? And also for SCHED_OTHER, what is that dynamic priority,which API to be used for that? – Gughan Feb 17 '12 at 08:37
  • to change the nice value you can the posix functions http://linux.die.net/man/2/nice the dynamic value itself you cant change that would be nasty – phschoen Feb 17 '12 at 08:57
  • posix function like pthread_setschedprio are used for Real time policies like SCHED_RR and SCHED_FIFO, but for SCHED_OTHER i couldn't find posix function, if so kindly provide the name of the posix function. – Gughan Feb 17 '12 at 09:01
  • for setting and getting the nice value you can use "getpriority(int which, int who)" and "setpriority(int which, int who, int prio)" http://linux.die.net/man/2/getpriority – phschoen Feb 17 '12 at 09:17
  • click the checkmark next to the answer until its green if you liked the answer :) – phschoen Feb 17 '12 at 09:47