• David S. Miller's avatar
    Fix scheduler deadlock on some platforms. · e9a1648b
    David S. Miller authored
    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.
    e9a1648b
sched.c 39.4 KB