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
1111 * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
1212 * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority
1313 * 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.
2014 */
2115
22−#define MAX_USER_RT_PRIO 100
23−#define MAX_RT_PRIO MAX_USER_RT_PRIO
16+#define MAX_RT_PRIO 100
2417
2518 #define MAX_PRIO (MAX_RT_PRIO + NICE_WIDTH)
2619 #define DEFAULT_PRIO (MAX_RT_PRIO + NICE_WIDTH / 2)
kernel/sched/core.c+3−4
@@ -5911,11 +5911,10 @@ recheck: · 5910 unmodified lines
59115911
59125912 /*
59135913 * 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,
59155915 * SCHED_BATCH and SCHED_IDLE is 0.
59165916 */
5917− if ((p->mm && attr->sched_priority > MAX_USER_RT_PRIO-1) ||
5918− (!p->mm && attr->sched_priority > MAX_RT_PRIO-1))
5917+ if (attr->sched_priority > MAX_RT_PRIO-1)
59195918 return -EINVAL;
59205919 if ((dl_policy(policy) && !__checkparam_dl(attr)) ||
59215920 (rt_policy(policy) != (attr->sched_priority != 0)))
@@ -6983,7 +6982,7 @@ SYSCALL_DEFINE1(sched_get_priority_max, int, policy) · 1061 unmodified lines
69836982 switch (policy) {
69846983 case SCHED_FIFO:
69856984 case SCHED_RR:
6986− ret = MAX_USER_RT_PRIO-1;
6985+ ret = MAX_RT_PRIO-1;
69876986 break;
69886987 case SCHED_DEADLINE:
69896988 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