Scheduler question (Bug in handling of idle tasks?)

Jean Wolter (jw5@os.inf.tu-dresden.de)
10 Aug 1998 18:50:43 +0200


Hello,

some days ago I've posted bug report about a 'page fault from irq
handler' in 2.1.112. There were several strange things:

1. The call trace and the current eip didn't match. There was no call
from the last function on top of stack to the function executed by the
processor.

2. The idle task (process 0) was running on processor 3.

Since I've thought, that we would have one idle task per processor I
wonder why process 0 is running on processor 3.

I tried to understand what the scheduler and the idle task are doing
and there are some things I don't understand:

1. Is it possible, that one of the idle tasks is scheduled on another
processor then the one it was created for?

The schedule function simply looks for schedulable processes
(processes which are ready and don't have any processors assigned
to it) and selects the one with the highest "value". Since the
idle tasks are normal processes they can be selected to run on any
processor or do I miss something. (Is it enough to increase the
weight in goodness to guarantee, that we select the right idle
task?)

How can it happen, that process 0 is running on cpu 3?

2. If it happens somehow, that an idle process is scheduled on another
process then the one it was created for ... Can it happen that an idle
task is scheduled to two different processors?

The scheduler starts its calculation with the idle task of the
current processor. If it finds no other schedulable process it
selects the idle process. There is no test whether the selected
idle task has a processor assigned.

This would explain the completely bogus call trace of my bug
report. If the idle process (process 0) was selected for
processor 3 and some times later (as the default choice) for
processor 0 ...

Maybe I simply miss something so maybe someone can shed some light on
it?

Jean

-- 
I get up each morning, gather my wits.
Pick up the paper, read the obits.
if I'm not there I know I'm not dead.
So I eat a good breakfast and go back to bed. Peete Seeger

- 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.altern.org/andrebalsa/doc/lkml-faq.html