Re: divide error trying to set rt_period to zero

From: Ingo Molnar
Date: Tue Jul 01 2008 - 02:26:33 EST



* Raistlin <raistlin@xxxxxxxx> wrote:

> Ops! :-O
>
> My fault, moving the 'if' back and forth from one function to another
> I finally sent the wrong (and broken!) version of the patch... Very
> sorry about it!
>
> I know, I would have noticed just looking at the code... But I missed
> it. :-(

hey, no problem.

> Anyway, if still interested in, the following one build and work...
> I've just tried it and I'm quite sure this time. :-P

applied to tip/sched/urgent - thanks Dario. We are interested in it of
course, you fixed a real bug in the scheduler :-)

small sidenote:

> +++ b/kernel/sched.c
> @@ -8501,6 +8501,9 @@ int sched_group_set_rt_period(struct task_group
> *tg, long rt_period_us)
> rt_period = (u64)rt_period_us * NSEC_PER_USEC;
> rt_runtime = tg->rt_bandwidth.rt_runtime;
>
> + if (rt_period == 0)
> + return -EINVAL;
> +
> return tg_set_bandwidth(tg, rt_period, rt_runtime);
> }

that patch was whitespace damaged (lines wrapped and tabs converted to
spaces). I fixed it up by hand - you can avoid such problems with future
patches by sending patches a'la Documentation/email-clients.txt.

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/