
Figure: Bottom Half Handling Data Structures
There are often times when you don’t want the
There can be up to 32 different bottom half handlers, which are referenced
through a vector of pointers called bh_base. These pointers point to each of
the kernel’s bottom half handling routines.
bh_active and bh_mask have their bits set according to what handlers have been installed and are
active. If bit N of bh_mask is set then the Nth element of bh_base contains the address of a bottom
half routine. If bit N of bh_active is set then the Nth bottom half handler routine
should be called as soon as the scheduler deems reasonable.
These indices are statically defined. The timer bottom half handler (index 0)
is the highest priority, the console bottom half handler (index 1) is next in
priority and so on. Typically the bottom half handling routines have lists of
tasks associated with them. For example, the immediate bottom half handler works its way
through the immediate tasks
Some of the
- TIMER
- This handler is marked as active each time the system’s
periodic timer interrupts and is used to drive the
kernel ‘s timerqueue mechanisms, - CONSOLE
- This handler is used to process console messages,
- TQUEUE
- This handler is used to process tty messages,
- NET
- This handler handles general network processing,
- IMMEDIATE
- This is a generic handler used by several device drivers
to
queue work to be done later.
Whenever a
The bit in bh_active is cleared as each bottom half handling routine is called. bh_active is transient; it only has meaning between calls to the scheduler and is a way of not calling bottom half handling routines when there is no work for them to do.