Linux SCHED_OTHER,SCHED_FIFO和SCHED_RR - 差异

时间:2022-01-04 05:01:54

Can someone explain the differences between SCHED_OTHER, SCHED_FIFO and SCHED_RR?

有人可以解释SCHED_OTHER,SCHED_FIFO和SCHED_RR之间的区别吗?

Thanks

谢谢

1 个解决方案

#1


39  

SCHED_FIFO and SCHED_RR are so called "real-time" policies. They implement the fixed-priority real-time scheduling specified by the POSIX standard. Tasks with these policies preempt every other task, which can thus easily go into starvation (if they don't release the CPU).

SCHED_FIFO和SCHED_RR是所谓的“实时”策略。它们实现POSIX标准指定的固定优先级实时调度。具有这些策略的任务会抢占所有其他任务,因此很容易陷入饥饿(如果他们不释放CPU)。

The difference between SCHED_FIFO and SCHED_RR is that among tasks with the same priority, SCHED_RR performs a round-robin with a certain timeslice; SCHED_FIFO, instead, needs the task to explicitly yield the processor.

SCHED_FIFO和SCHED_RR之间的区别在于具有相同优先级的任务中,SCHED_RR执行具有特定时间片的循环;相反,SCHED_FIFO需要任务明确地产生处理器。

SCHED_OTHER is the common round-robin time-sharing scheduling policy that schedules a task for a certain timeslice depending on the other tasks running in the system.

SCHED_OTHER是常见的循环时间共享调度策略,它根据系统中运行的其他任务来调度特定时间片的任务。

Update: since Linux 3.14, there is an additional policy called SCHED_DEADLINE. This policy implements the Constant Bandwidth Server (CBS) algorithm on top of Earliest Deadline First queues. Each task under this policy is assigned a deadline, and the earliest-deadline task is executed. The best resource describing this algorithm is Deadline scheduling in the Linux kernel.

更新:自Linux 3.14起,还有一个名为SCHED_DEADLINE的附加策略。此策略在最早期限第一个队列之上实现恒定带宽服务器(CBS)算法。为此策略下的每个任务分配一个截止日期,并执行最早期限任务。描述该算法的最佳资源是Linux内核中的截止日期调度。

Update 2: since Linux 4.13, SCHED_DEADLINE has replaced CBS with the Greedy Reclamation of Unused Bandwidth (GRUB) algorithm.

更新2:自Linux 4.13起,SCHED_DEADLINE已将CBS替换为未使用带宽的贪婪回收(GRUB)算法。

#1


39  

SCHED_FIFO and SCHED_RR are so called "real-time" policies. They implement the fixed-priority real-time scheduling specified by the POSIX standard. Tasks with these policies preempt every other task, which can thus easily go into starvation (if they don't release the CPU).

SCHED_FIFO和SCHED_RR是所谓的“实时”策略。它们实现POSIX标准指定的固定优先级实时调度。具有这些策略的任务会抢占所有其他任务,因此很容易陷入饥饿(如果他们不释放CPU)。

The difference between SCHED_FIFO and SCHED_RR is that among tasks with the same priority, SCHED_RR performs a round-robin with a certain timeslice; SCHED_FIFO, instead, needs the task to explicitly yield the processor.

SCHED_FIFO和SCHED_RR之间的区别在于具有相同优先级的任务中,SCHED_RR执行具有特定时间片的循环;相反,SCHED_FIFO需要任务明确地产生处理器。

SCHED_OTHER is the common round-robin time-sharing scheduling policy that schedules a task for a certain timeslice depending on the other tasks running in the system.

SCHED_OTHER是常见的循环时间共享调度策略,它根据系统中运行的其他任务来调度特定时间片的任务。

Update: since Linux 3.14, there is an additional policy called SCHED_DEADLINE. This policy implements the Constant Bandwidth Server (CBS) algorithm on top of Earliest Deadline First queues. Each task under this policy is assigned a deadline, and the earliest-deadline task is executed. The best resource describing this algorithm is Deadline scheduling in the Linux kernel.

更新:自Linux 3.14起,还有一个名为SCHED_DEADLINE的附加策略。此策略在最早期限第一个队列之上实现恒定带宽服务器(CBS)算法。为此策略下的每个任务分配一个截止日期,并执行最早期限任务。描述该算法的最佳资源是Linux内核中的截止日期调度。

Update 2: since Linux 4.13, SCHED_DEADLINE has replaced CBS with the Greedy Reclamation of Unused Bandwidth (GRUB) algorithm.

更新2:自Linux 4.13起,SCHED_DEADLINE已将CBS替换为未使用带宽的贪婪回收(GRUB)算法。