Software timers and delay functions
A software timer allows a function to be invoked on expiry of a time duration. There are two types of timers: dynamic timers used by the kernel and interval timers used by the user-space processes. Apart from software timers, there is another type of commonly used timing function called delay functions. Delay functions implement a precise loop, which is executed as per (usually as many times as the) delay function's argument.
Dynamic timers
Dynamic timers can be created and destroyed at any time, hence the name dynamic timers. Dynamic timers are represented by the struct timer_list
object, defined in include/linux/timer.h
:
structtimer_list{/* * Every field that changes during normal runtime grouped to the * same cacheline */structhlist_nodeentry;unsignedlongexpires;void(*function)(unsignedlong);unsignedlongdata;u32flags;#ifdef CONFIG_LOCKDEPstructlockdep_maplockdep_map;#endif};
All timers in a system are managed by a doubly linked list...