6 * The timer ticks with a frequency, interrupting the system
7 * Necessary for preemptive scheduling, using a time slice
8 * Linux counts the number of ticks in the *jiffies* variable
9 * It's interrupted *HZ* times in a second
21 * set\\_current\\_state
22 * TASK\\_INTERRUPTIBLE
23 * TASK\\_UNINTERRUPTIBLE
26 * schedule\\_timeout\\_interruptible
28 * msleep\\_interruptible
34 - unsigned long expires
35 - void function(unsigned long)
46 * Queues of functions to be called in a kernel thread
47 * They execute in process context, so they may sleep
48 * However, accessing user space memory does not make sense here
49 * Works should not take long or they will delay other works execution
50 * There's a default workqueue, keventd or events
54 * include linux/workqueue.h
55 * struct work\\_struct
56 * DECLARE\\_WORK(name, func)
57 * INIT\\_WORK(work, func)
58 * queue\\_work(wq, work)
59 * schedule\\_work(work)
61 * cancel\\_work\\_sync(work)
65 * struct delayed\\_work
66 * DECLARE\\_DELAYED\\_WORK(name, func)
67 * INIT\\_DELAYED\\_WORK(dwork, func)
68 * queue\\_delayed\\_work(wq, dwork, delay)
69 * schedule\\_delayed\\_work(dwork, delay)
70 * flush\\_delayed\\_work(dwork)
71 * cancel\\_delayed\\_work(dwork)
72 * cancel\\_delayed\\_work\\_sync(dwork)
76 * create\\_workqueue(name)
77 * create\\_singlethread\\_workqueue(name)
78 * destroy\\_workqueue(wq)
79 * flush\\_workqueue(wq)
80 * flush\\_scheduled\\_work()
84 * include linux/interrupt.h
85 * struct tasklet\\_struct
86 * DECLARE\\_TASKLET(name, func, data)
87 * tasklet\\_init(tsk, func, data)
89 * tasklet\\_hi\\_schedule
96 * include linux/completion.h
98 * DECLARE\\_COMPLETION(name)
99 * init\\_completion(comp)
100 * wait\\_for\\_completion(comp)
101 * wait\\_for\\_completion\\_interruptible
102 * wait\\_for\\_completion\\_timeout
107 * include linux/wait.h
108 * wait\\_queue\\_head\\_t
109 * DECLARE\\_WAIT\\_QUEUE\\_HEAD(name)
110 * init\\_waitqueue\\_head(wqh)
112 * wait\\_event(wqh, cond)
113 * wait\\_event\\_timeout(wqh, cond, timeout)
114 * wait\\_event\\_interruptible(wqh, cond)