Is a process with a priority of 0 legal ?

Date: Thu Sep 07 2000 - 09:56:22 EST

If it is the 2.2.16 scheduler & other linux'es have a bug.

The following code snippets can go into a tight loop.
while (p != &init_task)
     if (can_schedule(p))
          int weight = goodness(prev, p, this_cpu);
          if (weight > c)
               c = weight, next = p;
     p = p->next_run;

/* Do we need to re-calculate counters? */
if (!c)
     goto recalculate;

     struct task_struct *p;
          p->counter = (p->counter >> 1) + p->priority;
     goto repeat_schedule;

If the weight & priority of all runnable processes is 0 then the
recalculate with recalculate p->counter=0 for all runnable processes,
& the code will go into a tight loop between the goodness calculation &

Not very robust in my opinion.

D.J. Barrow Linux for S/390 kernel developer
Phone: +49-(0)7031-16-2583
IBM Germany Lab, Schönaicherstr. 220, 71032 Böblingen

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

This archive was generated by hypermail 2b29 : Thu Sep 07 2000 - 21:00:30 EST