Fix scheduler deadlock on some platforms.
Some platforms need to grab mm->page_table_lock during switch_mm(). On the other hand code like swap_out() in mm/vmscan.c needs to hold mm->page_table_lock during wakeups which needs to grab the runqueue lock. This creates a conflict and the resolution chosen here is to not hold the runqueue lock during context_switch(). The implementation is specifically a "frozen" state implemented as a spinlock, which is held around the context_switch() call. This allows the runqueue lock to be dropped during this time yet prevent another cpu from running the "not switched away from yet" task.
Showing
Please register or sign in to comment