计划政策 [英] Scheduling Policy

查看:94
本文介绍了计划政策的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在处理嵌入式项目时;在将调度策略从SCHED_OTHER更改为SCHED_RR的过程中,我遇到了计时器问题和流加载延迟.在SCHED_OTHER期间某些问题不会出现,但在SCHED_RR中出现(循环).

更改计划策略会产生什么影响.在更改策略期间在嵌入式项目中实现内核模块时需要注意什么?

解决方案

SCHED_RR带有时间片,因此该过程是否完成了该时间片 下一个过程将开始.如果您的时间片足够长,那么简短的IO流程 与cpu相比,它将具有劣势,因为cpu任务会在整个时间段内阻塞CPU.但是请注意,如果您减少时间片,那么您将获得更多的上下文切换,因此执行此更高职责时的性能会降低.我还提供了优先级.

SCHED_OTHER与RR不同,因此不提供静态优先级. 它具有一个动态优先级,如果该流程可以运行,则动态优先级会增加,但在 等待队列.如果该进程处于活动状态,它将重置为0.您还可以将动态值的范围从-20缩放到19(在19上,该过程很好,并且等待时间更长)

我主要在嵌入式系统中使用SCHED_OTHER和SCHED_FIFO

致以最诚挚的问候 肯尼

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?

解决方案

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

这篇关于计划政策的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆