mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Raistlin <raistlin@linux.it>
To: Ingo Molnar <mingo@elte.hu>
Cc: Michael Trimarchi <trimarchimichael@yahoo.it>,
	PeterZijlstra <peterz@infradead.org>, "Daniel K." <dk@uw.no>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: divide error trying to set rt_period to zero
Date: Thu, 26 Jun 2008 18:54:09 +0200	[thread overview]
Message-ID: <1214499251.10344.7.camel@Palanthas.Krynn> (raw)
In-Reply-To: <20080626133924.GA20188@elte.hu>

[-- Attachment #1: Type: text/plain, Size: 1949 bytes --]

On Thu, 2008-06-26 at 15:39 +0200, Ingo Molnar wrote:
> > @@ -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 (period == 0)
> > +		return -EINVAL;
> 
> this patch doesnt even build, because there's no "period" variable.
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. :-(

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

Sorry again and Regards,
Dario Faggioli

Signed-off-by: Dario Faggioli <raistlin@linux.it>
Signed-off-by: Michael Trimarchi <trimarchimichael@yahoo.it>
---
diff --git a/kernel/sched.c b/kernel/sched.c
index 3aaa5c8..696758f 100644
--- a/kernel/sched.c
+++ 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);
 }

-- 
<<This happens because I choose it to happen!>>
(Raistlin Majere, DragonLance Chronicles -Dragons of Spring Drawning-)
----------------------------------------------------------------------
Dario Faggioli
GNU/Linux Registered User: #340657
Web: http://www.linux.it/~raistlin
Blog: http://blog.linux.it/raistlin
SIP Account: dario.faggioli@sipproxy.wengo.fr or
             raistlin@ekiga.net
Jabber Account: dario.faggioli@jabber.org/WengoPhone
GnuPG Key ID: 4DC83AC4
GnuPG Key Fingerprint: 2A78 AD5D B9CF A082 0836 08AD 9385 DA04 4DC8 3AC4

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2008-06-26 18:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-25 22:17 Dario Faggioli
2008-06-26 13:39 ` Ingo Molnar
2008-06-26 16:54   ` Raistlin [this message]
2008-07-01  6:26     ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1214499251.10344.7.camel@Palanthas.Krynn \
    --to=raistlin@linux.it \
    --cc=dk@uw.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=trimarchimichael@yahoo.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®