Re: [PATCH 1/4] sched: set p->prio reguardless of p->mm
From: Steven Rostedt
Date: Fri Apr 24 2020 - 09:55:07 EST
On Fri, 24 Apr 2020 12:30:41 +0800
Hillf Danton <hdanton@xxxxxxxx> wrote:
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -4795,14 +4795,6 @@ recheck:
> if (attr->sched_flags & ~(SCHED_FLAG_ALL | SCHED_FLAG_SUGOV))
> return -EINVAL;
>
> - /*
> - * Valid priorities for SCHED_FIFO and SCHED_RR are
> - * 1..MAX_USER_RT_PRIO-1, valid priority for SCHED_NORMAL,
> - * SCHED_BATCH and SCHED_IDLE is 0.
> - */
> - if ((p->mm && attr->sched_priority > MAX_USER_RT_PRIO-1) ||
> - (!p->mm && attr->sched_priority > MAX_RT_PRIO-1))
> - return -EINVAL;
So if someone passes in sched_priority > MAX_RT_PRIO-1, where does it get
checked?
-- Steve
> if ((dl_policy(policy) && !__checkparam_dl(attr)) ||
> (rt_policy(policy) != (attr->sched_priority != 0)))
> return -EINVAL;