While I understand that some context switches are caused by page faults, does a page fault definitely cause context switch?
Yes. If this happens because your program in user-mode leads to a "page_fault" the CPU in which it is running receives the interrupt of "page_fault" and the context of the current execution must be saved in the system's stack space (typically is the firmware to do this) so that the control is passed to the handler of "page_fault" ("ENTRY(page_fault)" defined in /kernel/entry.S).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With