Re: [6/7] sched/rt: make it configurable

From: Nicolas Pitre
Date: Wed May 31 2017 - 12:25:59 EST


On Wed, 31 May 2017, Rob Herring wrote:

> On Mon, May 29, 2017 at 05:03:01PM -0400, Nicolas Pitre wrote:
> > On most small systems where user space is tightly controlled, the realtime
> > scheduling class can often be dispensed with to reduce the kernel footprint.
> > Let's make it configurable.
> >
> > Signed-off-by: Nicolas Pitre <nico@xxxxxxxxxx>
> > ---
>
> > static inline int rt_prio(int prio)
> > {
> > - if (unlikely(prio < MAX_RT_PRIO))
> > + if (IS_ENABLED(CONFIG_SCHED_RT) && unlikely(prio < MAX_RT_PRIO))
> > return 1;
> > return 0;
> > }
>
> > #ifdef CONFIG_PREEMPT_NOTIFIERS
> > INIT_HLIST_HEAD(&p->preempt_notifiers);
> > @@ -3716,13 +3720,18 @@ void rt_mutex_setprio(struct task_struct *p, struct task_struct *pi_task)
> > p->sched_class = &dl_sched_class;
> > } else
> > #endif
> > +#ifdef CONFIG_SCHED_RT
> > if (rt_prio(prio)) {
>
> This ifdef is not necessary since rt_prio is conditioned on
> CONFIG_SCHED_RT already.

Yeah, that was the intent. In many places the conditioned code
dereferences p->rt.* and the compiler complains. So I added a couple
#ifdefs to make it build until something better comes to mind. This
particular one was unnecessary.

I'm on prettifying the whole thing at the moment. I wanted early
comments and so far they're all meaning the same thing which is good.


Nicolas