Notifier Chains and Completion Functions
Kernel helper interfaces make life easier for developers. Learn about notifier chains, completion functions and error handling aids.
Over the last couple of months,” Gearheads” showed how you can benefit from kernel helpers, such as linked lists, work queues and seq files. This month, let’s continue and explore more helper interfaces, like notifier chains, completion functions, kernel thread helpers, and error handling aids.
Notifier Chains
Notifier chains send status change messages to code regions that request them. Unlike hard-coded mechanisms, notifiers offer a versatile technique for dynamically loadable code to get notified when events of interest occur. Notifier chains were originally added to pass network events to concerned sections of the kernel, but are now used for many other purposes.
The kernel implements a number of predefined notifiers for significant events. For example:
1.A die notification is sent when a kernel function triggers a trap or a fault, caused by an oops, page fault, or a breakpoint.
2.A network device notification is generated when a network interface goes up or down.
3.A CPU frequency notification is generated when there’s a transition in processor frequency.
4.A Internet address notification is sent when a change is detected in the IP address of a network interface.