Re: scheduling policy of bottom halfs, task_queues and timers?

pwhiting@fury.ittc.ukans.edu
Thu, 8 Apr 1999 11:42:32 -0500


Others on the list can probably do a better job explaining, but I
will make an attempt anyway. Perhaps some will correct me and I
will learn too.

My understanding is bottom halves (halfs?) are allowed to run to
completion.

They are "scheduled" to run under two conditions. In
arch/whatever/kernel/entry.S you will find the BHs executed prior
to returning from a system call:

ret_from_sys_call:
movl SYMBOL_NAME(bh_mask),%eax
andl SYMBOL_NAME(bh_active),%eax
jne handle_bottom_half

The second place they are executed is when the scheduler is about
to make a decision on which process to run next - right at the
top of the schedule routine in linux/sched.c you will find:

if (bh_active & bh_mask)
do_bottom_half();

Also in this routine you will find the scheduler task queue
being run explicitly. The other two predefined task queues
(timer and immediate) are run as bottom halves. YANTQ (yet
another task queue) tq_disk is defined but it isn't apparent
that this is used in the same way the others are (look in
drivers/block/ll_rw_blk.c for example usage.)

I saw reference to the immediate task queue being run immediately
upon exit from an interrupt handler, but I haven't tracked that
down in the code yet.

I good article on bottom halves/task queues was written by
Alessandro Rubini and Georg v. Zezschwitz and can be found
at: http://www.linuxjournal.com/issue26/interrupt.html.

good luck.

pete

On Thu, Apr 08, 1999 at 11:21:59AM -0400, Kirk Reiser wrote:
> Could someone explain the scheduling policy around bottom-halfs,
> task_queues and timer_lists. If one of the functions has been called
> from these types, are they subject to normal time slicing or are they
> allowed to run to completion? The documentation I've read doesn't
> really address this point.
>
> Kirk
>
> -
> 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/

-
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/