History

sched: Remove MAX_USER_RT_PRIO

Commit d46523ea32a7 ("[PATCH] fix MAX_USER_RT_PRIO and MAX_RT_PRIO") was introduced due to a a small time period in which the realtime patch set was using different values for MAX_USER_RT_PRIO and MAX_RT_PRIO. This is no longer true, i.e. now MAX_RT_PRIO == MAX_USER_RT_PRIO. Get rid of MAX_USER_RT_PRIO and make everything use MAX_RT_PRIO instead.

Dietmar Eggemann committed 5 years ago

Commit ae18ad21 parent 71e5f662 files · +4 −12Browse files

Unified · Split

2 files
  1. include/linux/sched/prio.h +1 −8
  2. kernel/sched/core.c +3 −4
include/linux/sched/prio.h+1−8
@@ -11,16 +11,9 @@ · 10 unmodified lines
11 * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH11 * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
12 * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority12 * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority
13 * values are inverted: lower p->prio value means higher priority.13 * values are inverted: lower p->prio value means higher priority.
14 *
15 * The MAX_USER_RT_PRIO value allows the actual maximum
16 * RT priority to be separate from the value exported to
17 * user-space. This allows kernel threads to set their
18 * priority to a value higher than any user task. Note:
19 * MAX_RT_PRIO must not be smaller than MAX_USER_RT_PRIO.
20 */14 */
21 15
22#define MAX_USER_RT_PRIO 10016#define MAX_RT_PRIO 100
23#define MAX_RT_PRIO MAX_USER_RT_PRIO
24 17
25#define MAX_PRIO (MAX_RT_PRIO + NICE_WIDTH)18#define MAX_PRIO (MAX_RT_PRIO + NICE_WIDTH)
26#define DEFAULT_PRIO (MAX_RT_PRIO + NICE_WIDTH / 2)19#define DEFAULT_PRIO (MAX_RT_PRIO + NICE_WIDTH / 2)
kernel/sched/core.c+3−4
@@ -5911,11 +5911,10 @@ recheck: · 5910 unmodified lines
5911 5911
5912 /*5912 /*
5913 * Valid priorities for SCHED_FIFO and SCHED_RR are5913 * Valid priorities for SCHED_FIFO and SCHED_RR are
5914 * 1..MAX_USER_RT_PRIO-1, valid priority for SCHED_NORMAL,5914 * 1..MAX_RT_PRIO-1, valid priority for SCHED_NORMAL,
5915 * SCHED_BATCH and SCHED_IDLE is 0.5915 * SCHED_BATCH and SCHED_IDLE is 0.
5916 */5916 */
5917 if ((p->mm && attr->sched_priority > MAX_USER_RT_PRIO-1) ||5917 if (attr->sched_priority > MAX_RT_PRIO-1)
5918 (!p->mm && attr->sched_priority > MAX_RT_PRIO-1))
5919 return -EINVAL;5918 return -EINVAL;
5920 if ((dl_policy(policy) && !__checkparam_dl(attr)) ||5919 if ((dl_policy(policy) && !__checkparam_dl(attr)) ||
5921 (rt_policy(policy) != (attr->sched_priority != 0)))5920 (rt_policy(policy) != (attr->sched_priority != 0)))
@@ -6983,7 +6982,7 @@ SYSCALL_DEFINE1(sched_get_priority_max, int, policy) · 1061 unmodified lines
6983 switch (policy) {6982 switch (policy) {
6984 case SCHED_FIFO:6983 case SCHED_FIFO:
6985 case SCHED_RR:6984 case SCHED_RR:
6986 ret = MAX_USER_RT_PRIO-1;6985 ret = MAX_RT_PRIO-1;
6987 break;6986 break;
6988 case SCHED_DEADLINE:6987 case SCHED_DEADLINE:
6989 case SCHED_NORMAL:6988 case SCHED_NORMAL:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t