[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTinotRxScOHEb0HgFgSpGPkq_6jKTv5CfvnQM=ee@mail.gmail.com>
Date: Thu, 6 Jan 2011 10:28:11 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Ingo Molnar <mingo@...e.hu>
Cc: linux-kernel@...r.kernel.org,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Mike Galbraith <efault@....de>,
Thomas Gleixner <tglx@...utronix.de>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [GIT PULL] scheduler changes for v2.6.38
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, ¶m);
> 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, ¶m);
It's just nasty and horrible.
Now, something like
"static const struct sched_param param = .."
is fine, if it's really a const thing. But if it's non-const, don't
make it be a static inside a function. Please.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists