public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Daniel Walker <dwalker@mvista.com>
Cc: Ingo Molnar <mingo@elte.hu>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [git pull] scheduler updates for v2.6.27, phase #2
Date: Mon, 21 Jul 2008 21:23:02 +0200	[thread overview]
Message-ID: <1216668182.7257.80.camel@twins> (raw)
In-Reply-To: <1216657892.2294.34.camel@dhcp32.mvista.com>

On Mon, 2008-07-21 at 09:31 -0700, Daniel Walker wrote:
> On Mon, 2008-07-21 at 17:38 +0200, Ingo Molnar wrote:
> > Linus,
> > 
> > Please pull the latest sched/for-linus git tree from:
> > 
> >    git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git sched/for-linus
> > 
> > this includes the cpu_active_map changes (which cleans up scheduler and 
> > CPU hotplug interaction) and Peter's hrtick cleanup (which fixes the 
> > uvesafb regression) and assorted fixlets.
> 
> 
> I get this warning on powerpc builds (linus git as of a few days ago), 
> 
> /localuser/dwalker/linus/kernel/sched_rt.c: In function ‘do_balance_runtime’:
> /localuser/dwalker/linus/kernel/sched_rt.c:256: warning: comparison of distinct pointer types lacks a cast
> 
> I'm not exactly sure why .. Did this get fixed already?

Does this work for you?

---
shut up the type validation in asm-generic/div64.h:do_div()

its complaining diff isn't u64 - which is true, its s64. However we've
already checked its >0, so its safe. However we can't sanely cast since
do_div() is a macro.

Hence use an extra variable.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index 47ceac9..3a1be03 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -253,11 +253,13 @@ static int do_balance_runtime(struct rt_rq *rt_rq)
 
 		diff = iter->rt_runtime - iter->rt_time;
 		if (diff > 0) {
-			do_div(diff, weight);
+			u64 gain = diff;
+
+			do_div(gain, weight);
 			if (rt_rq->rt_runtime + diff > rt_period)
-				diff = rt_period - rt_rq->rt_runtime;
-			iter->rt_runtime -= diff;
-			rt_rq->rt_runtime += diff;
+				gain = rt_period - rt_rq->rt_runtime;
+			iter->rt_runtime -= gain;
+			rt_rq->rt_runtime += gain;
 			more = 1;
 			if (rt_rq->rt_runtime == rt_period) {
 				spin_unlock(&iter->rt_runtime_lock);



  reply	other threads:[~2008-07-21 19:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-21 15:38 [git pull] scheduler updates for v2.6.27, phase #2 Ingo Molnar
2008-07-21 16:31 ` Daniel Walker
2008-07-21 19:23   ` Peter Zijlstra [this message]
2008-07-21 20:16     ` Daniel Walker
2008-07-24 10:43       ` Peter Zijlstra
2008-07-24 11:09         ` Andrew Morton
2008-07-24 11:15           ` Peter Zijlstra
2008-07-24 11:24         ` Ingo Molnar
2008-07-24 19:12           ` Daniel Walker

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=1216668182.7257.80.camel@twins \
    --to=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=dwalker@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.org \
    /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