1, user preemption:
Return system call from user space or interrupt, the current process need_resched check mark (located thread_info structural body), when the flag is 0, the process switching can occur.
2, kernel preemption:
When in the kernel space, kernel space to return from the interrupt or re preempt_count count is 0 (all locks held by the current process are released) and need_resched == 0, the system is in the process context, this case may occur secure handover process.
Kernel preemption opportunity: call schedule interrupt handler returns kernel space, kernel code to regain a preemption kernel code is blocked or display () function.
Keywords: preempt_count
Interrupt can only be interrupted by a higher priority interrupt can not be interrupted by any other event.