[lkml]   [1998]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Who (and when) is calling the scheduler ? -- More confusion ...

Anton Ghiugan <> writes:

> Now I am totally confused! On one hand you tell me that the timer
> interrupt will actually run the TIMER_BH if it is not already running,
> and on the other hand to tell me that it is only queueing the TIMER_BH
> (what exactly this means? will the timer interrupt add a new entry in
> the queue? what entry is that?)

The timer interrupt will mark the timer bh for running. The exit path
from the interrupt (see arch/i386/kernel/irq.c:do_IRQ) checks to see if
it needs to run any bottom halves and calls do_bottom_half (from
kernel/softirq.c) if it needs to. In that function, softirq_trylock()
uses an atomic test-and-set on global_bh_count to ensure that the
bottom-halves are never reentered.

The bh_active bitmap indicates which bottom halves are pending at any
time, but individual bh'es can be disabled at any time through bh_mask.

So, the timer interrupt _does_ run the TIMER_BH if it is not already
running. The way it does that is to queue the bh (by setting the
appropriate bit in the active mask), and then doing the normal
reentrance-safe bottom half processing when the interrupt returns.

> Because the timer interrupt is asyncronus in respect with the normal
> flow of instructions in the computer, it is possible that it may occur
> in the middle of the task processing of a bottom half

... in which case either the new bottom-half processing will be deferred
until the next interrupt. We could conceivably just loop in
run_bottom_halves until there are no more deliverable bottom halves,
which would get around to servicing the scheduler bh more quickly.


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

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