[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1254326342.11233.149.camel@Palantir>
Date: Wed, 30 Sep 2009 17:59:02 +0200
From: Raistlin <raistlin@...ux.it>
To: roel kluin <roel.kluin@...il.com>
Cc: Linus Walleij <linus.ml.walleij@...il.com>,
Peter Zijlstra <peterz@...radead.org>, claudio@...dence.eu.com,
michael@...dence.eu.com, mingo@...e.hu,
linux-kernel@...r.kernel.org, tglx@...utronix.de,
johan.eker@...csson.com, p.faure@...tech.ch,
Fabio Checconi <fabio@...dalf.sssup.it>,
Dhaval Giani <dhaval.giani@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Tommaso Cucinotta <tommaso.cucinotta@...up.it>
Subject: Re: [RFC][PATCH] SCHED_EDF scheduling class
On Tue, 2009-09-29 at 20:15 +0200, roel kluin wrote:
> shouldn't the NULL test be moved upwards, to prevent a dereference of
> a NULL pointer?
I definitely think you _do_ are right, many thanks! :-P
> Also I notice that `timespec_to_ns(¶m_ex->sched_period)'
> is called twice, maybe gcc does this but can't we do something like
>
> if (edf_policy(policy)) {
> if (param_ex == NULL || param_ex->sched_priority != 0)
> return -EINVAL;
> s64 psp = timespec_to_ns(¶m_ex->sched_period);
> if (psp == 0 || psp < timespec_to_ns(¶m_ex->sched_runtime))
> return -EINVAL;
> }
>
Well, don't know... I guess the compiler do _something_ (also since
timespec_to_ns is 'static inline') but, to be sincere, I've not looked
at the assembly yet... But I may check it out, at least for x86, and
then consider this. :)
Thanks very much for your comments and suggestions,
Dario
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
----------------------------------------------------------------------
Dario Faggioli, ReTiS Lab, Scuola Superiore Sant'Anna, Pisa (Italy)
http://blog.linux.it/raistlin / raistlin@...ga.net /
dario.faggioli@...ber.org
Download attachment "signature.asc" of type "application/pgp-signature" (198 bytes)
Powered by blists - more mailing lists