Do not retake the SCHED_LOCK when going out of mi_switch(). No code really depends on that and it is one extra mutex operation for no good reason.
Switch spc_curpriority to be volatile. It is only modified by the curcpu()
but read by other CPUs. Mark it like this in sched.h.
OK mpi@