sched
Task state and queues
- from run queues to wait queues(two ways):
- create
wait_queue_twithDECLARE_WAITQUEUE(). - call
add_wait_queue()/__add_wait_queue()to add the task to a wait queue - set the state of task to
TASK_INTERRUPTIBLE - call
schedule()to switch contexts andschedule()will calldeactivate_task()to remove the task from a run queue
- from wait queues to run queues:
- call
try_to_wake_up()
