Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [pathch] kernel/sched.c bogon?
@ 2003-03-07  1:01 Kip Walker
  2003-03-07  1:40 ` Jun Sun
  2003-04-25 15:28 ` Kip Walker
  0 siblings, 2 replies; 6+ messages in thread
From: Kip Walker @ 2003-03-07  1:01 UTC (permalink / raw)
  To: linux-mips


The comparisons of oldest_idle below trigger compiler warnings and
should probably be safely type-cast:

Kip

Index: kernel/sched.c
===================================================================
RCS file: /home/cvs/linux/kernel/sched.c,v
retrieving revision 1.64.2.6
diff -u -r1.64.2.6 sched.c
--- kernel/sched.c      25 Feb 2003 22:03:13 -0000      1.64.2.6
+++ kernel/sched.c      7 Mar 2003 00:57:35 -0000
@@ -282,7 +282,7 @@
                                target_tsk = tsk;
                        }
                } else {
-                       if (oldest_idle == -1ULL) {
+                       if (oldest_idle == (cycles_t) -1) {
                                int prio = preemption_goodness(tsk, p,
cpu);
 
                                if (prio > max_prio) {
@@ -294,7 +294,7 @@
        }
        tsk = target_tsk;
        if (tsk) {
-               if (oldest_idle != -1ULL) {
+               if (oldest_idle != (cycles_t) -1) {
                        best_cpu = tsk->processor;
                        goto send_now_idle;
                }

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [pathch] kernel/sched.c bogon?
  2003-03-07  1:01 [pathch] kernel/sched.c bogon? Kip Walker
@ 2003-03-07  1:40 ` Jun Sun
  2003-03-10 12:55   ` Ralf Baechle
  2003-04-25 15:28 ` Kip Walker
  1 sibling, 1 reply; 6+ messages in thread
From: Jun Sun @ 2003-03-07  1:40 UTC (permalink / raw)
  To: Kip Walker; +Cc: linux-mips, jsun


I reported this bug last May.  Apparently it is still not
taken up-stream.   Ralf, why don't we fix it here and push
it up from you?

BTW, this bug actually has effect on real-time performance under
preemptible kernel.  It can delay the execution of the highest
priority real-time process from execution up to 1 jiffy.

Jun

On Thu, Mar 06, 2003 at 05:01:24PM -0800, Kip Walker wrote:
> 
> The comparisons of oldest_idle below trigger compiler warnings and
> should probably be safely type-cast:
> 
> Kip
> 
> Index: kernel/sched.c
> ===================================================================
> RCS file: /home/cvs/linux/kernel/sched.c,v
> retrieving revision 1.64.2.6
> diff -u -r1.64.2.6 sched.c
> --- kernel/sched.c      25 Feb 2003 22:03:13 -0000      1.64.2.6
> +++ kernel/sched.c      7 Mar 2003 00:57:35 -0000
> @@ -282,7 +282,7 @@
>                                 target_tsk = tsk;
>                         }
>                 } else {
> -                       if (oldest_idle == -1ULL) {
> +                       if (oldest_idle == (cycles_t) -1) {
>                                 int prio = preemption_goodness(tsk, p,
> cpu);
>  
>                                 if (prio > max_prio) {
> @@ -294,7 +294,7 @@
>         }
>         tsk = target_tsk;
>         if (tsk) {
> -               if (oldest_idle != -1ULL) {
> +               if (oldest_idle != (cycles_t) -1) {
>                         best_cpu = tsk->processor;
>                         goto send_now_idle;
>                 }
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [pathch] kernel/sched.c bogon?
  2003-03-07  1:40 ` Jun Sun
@ 2003-03-10 12:55   ` Ralf Baechle
  2003-03-10 17:59     ` Jun Sun
  0 siblings, 1 reply; 6+ messages in thread
From: Ralf Baechle @ 2003-03-10 12:55 UTC (permalink / raw)
  To: Jun Sun; +Cc: Kip Walker, linux-mips

On Thu, Mar 06, 2003 at 05:40:01PM -0800, Jun Sun wrote:

> I reported this bug last May.  Apparently it is still not
> taken up-stream.   Ralf, why don't we fix it here and push
> it up from you?
> 
> BTW, this bug actually has effect on real-time performance under
> preemptible kernel.

< = 2.4.x preemptible kernel is OPP.

>  It can delay the execution of the highest
> priority real-time process from execution up to 1 jiffy.

Quite a number of users get_cycles() in the kernel assume it to return a
64-bit number.  I guess we'll have to fake a 64-bit counter in software ...

  Ralf

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [pathch] kernel/sched.c bogon?
  2003-03-10 12:55   ` Ralf Baechle
@ 2003-03-10 17:59     ` Jun Sun
  2003-04-24 17:03       ` Kip Walker
  0 siblings, 1 reply; 6+ messages in thread
From: Jun Sun @ 2003-03-10 17:59 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Kip Walker, linux-mips, jsun

On Mon, Mar 10, 2003 at 01:55:31PM +0100, Ralf Baechle wrote:
> On Thu, Mar 06, 2003 at 05:40:01PM -0800, Jun Sun wrote:
> 
> > I reported this bug last May.  Apparently it is still not
> > taken up-stream.   Ralf, why don't we fix it here and push
> > it up from you?
> > 
> > BTW, this bug actually has effect on real-time performance under
> > preemptible kernel.
> 
> < = 2.4.x preemptible kernel is OPP.
> 
> >  It can delay the execution of the highest
> > priority real-time process from execution up to 1 jiffy.
> 
> Quite a number of users get_cycles() in the kernel assume it to return a
> 64-bit number.  I guess we'll have to fake a 64-bit counter in software ...
>

Whether we fake 64-bit or not, oldest_idle is declared as cycles_t.  
So comparing it with (cycles_t)-1 should be always be correct.  And it
actually makes a correct C program. :-)

I don't see any possible reason for rejecting the change.  My previous
report is probably just lost in the noise.

Jun

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [pathch] kernel/sched.c bogon?
  2003-03-10 17:59     ` Jun Sun
@ 2003-04-24 17:03       ` Kip Walker
  0 siblings, 0 replies; 6+ messages in thread
From: Kip Walker @ 2003-04-24 17:03 UTC (permalink / raw)
  To: Jun Sun; +Cc: Ralf Baechle, linux-mips

Jun Sun wrote:
> 
> On Mon, Mar 10, 2003 at 01:55:31PM +0100, Ralf Baechle wrote:
> > On Thu, Mar 06, 2003 at 05:40:01PM -0800, Jun Sun wrote:
> >
> > > I reported this bug last May.  Apparently it is still not
> > > taken up-stream.   Ralf, why don't we fix it here and push
> > > it up from you?
> > >
> > > BTW, this bug actually has effect on real-time performance under
> > > preemptible kernel.
> >
> > < = 2.4.x preemptible kernel is OPP.
> >
> > >  It can delay the execution of the highest
> > > priority real-time process from execution up to 1 jiffy.
> >
> > Quite a number of users get_cycles() in the kernel assume it to return a
> > 64-bit number.  I guess we'll have to fake a 64-bit counter in software ...
> >
> 
> Whether we fake 64-bit or not, oldest_idle is declared as cycles_t.
> So comparing it with (cycles_t)-1 should be always be correct.  And it
> actually makes a correct C program. :-)
> 
> I don't see any possible reason for rejecting the change.  My previous
> report is probably just lost in the noise.

And once again, the patch hasn't made it in.  Can we either apply it get
a good reason not to?

Kip

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [pathch] kernel/sched.c bogon?
  2003-03-07  1:01 [pathch] kernel/sched.c bogon? Kip Walker
  2003-03-07  1:40 ` Jun Sun
@ 2003-04-25 15:28 ` Kip Walker
  1 sibling, 0 replies; 6+ messages in thread
From: Kip Walker @ 2003-04-25 15:28 UTC (permalink / raw)
  To: linux-mips


Ralf?  I'm tying up loose ends between my tree and yours, and hoping to
push some things back.

Kip Walker wrote:
> 
> The comparisons of oldest_idle below trigger compiler warnings and
> should probably be safely type-cast:
> 
> Kip
> 
> Index: kernel/sched.c
> ===================================================================
> RCS file: /home/cvs/linux/kernel/sched.c,v
> retrieving revision 1.64.2.6
> diff -u -r1.64.2.6 sched.c
> --- kernel/sched.c      25 Feb 2003 22:03:13 -0000      1.64.2.6
> +++ kernel/sched.c      7 Mar 2003 00:57:35 -0000
> @@ -282,7 +282,7 @@
>                                 target_tsk = tsk;
>                         }
>                 } else {
> -                       if (oldest_idle == -1ULL) {
> +                       if (oldest_idle == (cycles_t) -1) {
>                                 int prio = preemption_goodness(tsk, p,
> cpu);
> 
>                                 if (prio > max_prio) {
> @@ -294,7 +294,7 @@
>         }
>         tsk = target_tsk;
>         if (tsk) {
> -               if (oldest_idle != -1ULL) {
> +               if (oldest_idle != (cycles_t) -1) {
>                         best_cpu = tsk->processor;
>                         goto send_now_idle;
>                 }

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-04-25 15:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-07  1:01 [pathch] kernel/sched.c bogon? Kip Walker
2003-03-07  1:40 ` Jun Sun
2003-03-10 12:55   ` Ralf Baechle
2003-03-10 17:59     ` Jun Sun
2003-04-24 17:03       ` Kip Walker
2003-04-25 15:28 ` Kip Walker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox