Linux Kernel Development: A practical guide to the design and implementation of the Linux kernel
Author: Robert Love

Chapter 6 -- Bottom Halves and Deferring Work

Introduction

Previously interrupt handlers were covered, but they are only the first half of the interrupt processing solution. While interrupt handlers provide response to hardware and time critical actions, less critical work can be dealt with at a later point allowing interrupts to be enabled. The second part of managing interrupts comes in the bottom half.

Bottom Halves

Why Bottom Halves?

A World of Bottom Halves

Bottom Half Confusion

Softirqs

Implementation of Softirqs

The Softirq Handler
Executing Softirqs

Using Softirqs

Assigning an Index
Registering Your Handler
Raising Your Softirq

Tasklets

Implementation of Tasklets

The Tasklet Structure
Scheduling Tasklets

Using Tasklets

Declaring Your Tasklet
Writing Your Tasklet Handler
Scheduling Your Tasklet

ksoftirqd

The Old BH Mechanism

Work Queues

Implementation of Work Queues

Data Structures Representing the Threads
Data Structures Representing the Work
Excuse Me?

Using Work Queues

Creating Work
Your Work Queue Handler
Scheduling Work
Flushing Work
Creating New Work Queues

The Old Task Queue Mechanism

Which Bottom Half Should I Use?

Locking Between the Bottom Halves

Disabling Bottom Halves

Notes prepared by Heidi Young, Western Washington University 2004