Which real-time priority is the highest priority in Linux

后端 未结 7 1656
长情又很酷
长情又很酷 2020-12-12 12:44

In the Linux real-time process priority range 1 to 99, it\'s unclear to me which is the highest priority, 1 or 99.

Section 7.2.2 of \"Understanding the Linux Kerne

相关标签:
7条回答
  • 2020-12-12 13:45

    This comment in sched.h is pretty definitive:

    /*
     * 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.
     */
    

    Note this part:

    Priority values are inverted: lower p->prio value means higher priority.

    0 讨论(0)
提交回复
热议问题