CPU interrupt context switching

In order to respond quickly to events hardware, scheduling and interrupt the normal execution process will interrupt the process and instead call the interrupt handler, event response equipment. And when interrupted by other processes, it is necessary to preserve the current state of the process, so that after the interruption, the process can still recover from the original run state.

With different process context switch, interrupt context switch does not relate to a user mode process. So, even interrupting the process interrupted by a user is in the process state does not need to save and restore the process of user mode virtual memory resources, global variables, and so on. Interrupt context, in fact, only the kernel mode includes a state necessary to execute the interrupt service routine, including CPU registers, the kernel stack, a hardware interrupt parameters.

For the same CPU, the interrupt process has a higher priority than the level that most interrupt handlers are short and pithy, while the end of the implementation as soon as possible. Interrupt context switching consumes CPU, to switch too many times will spend a lot of CPU, affect the overall system performance.

Guess you like

Origin blog.csdn.net/datuzijean/article/details/86652655