lkml.org 
[lkml]   [1998]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Tiny patch: nice 20 as idle priority
Hi!

> After we looked at some alternative schedulers for the linux kernel
> (the QNX-like scheduler, the sched_idle patch at Linux-MAMA)
> a friend of mine (Marco Bodrato <bodrato@linuz.sns.it> )
> wrote a tiny patch that allows nice 20 tasks, which get executed only when
> the kernel has no other (normal or real-time priority) tasks to run.
>
> As I said, the patch is really small, so I attach it directly to this e-mail.
> If someone is interested in it and/or gives a feedback, he's
> welcome.

It looks nicely, still...

> @@ -283,6 +285,9 @@
> weight += 1;
> }
>
> + if (!p->priority)
> + weight -= 999;
> +
> return weight;
> }

=> weight is likely to be small but probably _not_ -999

> @@ -457,9 +462,10 @@
> }
>
> /* if all runnable processes have "counter == 0", re-calculate counters */
> - if (!c) {
> + if (!c || c==-999) {

So you should not test if it is _exactly_ -999.

Not sure I see bug. I may.

Pavel

--
The best software in life is free (not shareware)! Pavel
GCM d? s-: !g p?:+ au- a--@ w+ v- C++@ UL+++ L++ N++ E++ W--- M- Y- R+

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:45    [W:0.168 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site