当前位置: 代码迷 >> 驱动开发 >> linux优先级解决方法
  详细解决方案

linux优先级解决方法

热度:44   发布时间:2016-04-28 10:46:56.0
linux优先级
sched_rr,sched_fifo.优先级大小是怎么排的?我sched_get_priority_min值是1,优先级最大是1还是99?
我看网上有说99是优先级最大的,也有说1是最大的。我内核中的注释是这样的
/*
 * Priority of a process goes from 0..MAX_PRIO-1, valid RT
 * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
 * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority
* values are inverted: lower p->prio value means higher priority.
 *
 * The MAX_USER_RT_PRIO value allows the actual maximum
 * RT priority to be separate from the value exported to
 * user-space. This allows kernel threads to set their
 * priority to a value higher than any user task. Note:
 * MAX_RT_PRIO must not be smaller than MAX_USER_RT_PRIO.
 */

#define MAX_USER_RT_PRIO 100
#define MAX_RT_PRIO MAX_USER_RT_PRIO

#define MAX_PRIO (MAX_RT_PRIO + 40)
#define DEFAULT_PRIO (MAX_RT_PRIO + 20)

究竟优先级设成什么值最大?

------解决方案--------------------
Priority
* values are inverted: lower p->prio value means higher priority.

-----------

0是最大的 越低越好

用户只能使用优先级低一些的
  相关解决方案