Re: [GIT PULL] scheduler changes for v2.6.38

From: Ingo Molnar
Date: Thu Jan 06 2011 - 18:53:58 EST



* Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> Ingo, can we please not do things like this:
>
> > diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
> > index 155a415..562c56e 100644
> > --- a/kernel/trace/trace_selftest.c
> > +++ b/kernel/trace/trace_selftest.c
> > @@ -558,7 +558,7 @@ trace_selftest_startup_nop(struct tracer *trace, struct trace_array *tr)
> >  static int trace_wakeup_test_thread(void *data)
> >  {
> >        /* Make this a RT thread, doesn't need to be too high */
> > -       struct sched_param param = { .sched_priority = 5 };
> > +       static struct sched_param param = { .sched_priority = 5 };
> >        struct completion *x = data;
> >
> >        sched_setscheduler(current, SCHED_FIFO, &param);
> > diff --git a/kernel/watchdog.c b/kernel/watchdog.c
> > index 5b08215..c812c49 100644
> > --- a/kernel/watchdog.c
> > +++ b/kernel/watchdog.c
> > @@ -307,7 +307,7 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer)
> >  */
> >  static int watchdog(void *unused)
> >  {
> > -       struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 };
> > +       static struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 };
> >        struct hrtimer *hrtimer = &__raw_get_cpu_var(watchdog_hrtimer);
> >
> >        sched_setscheduler(current, SCHED_FIFO, &param);
>
> It's just nasty and horrible.

Agreed, and i keep flaming people every time i notice it. Alas here i didnt notice
it and it slipped through. Will fix it.

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/