SMP - Process is stopped when VM modifies the page tables
- RTS_VMINHIBIT flag is used to stop process while VM is fiddling with its pagetables - more generic way of sending synchronous scheduling events among cpus - do the x-cpu smp sched calls only if the target process is runnable. If it is not, it cannot be running and it cannot become runnable this CPU holds the BKL
This commit is contained in:
@@ -56,13 +56,13 @@ PUBLIC int do_runctl(struct proc * caller, message * m_ptr)
|
||||
/* check if we must stop a process on a different CPU */
|
||||
if (rp->p_cpu != cpuid) {
|
||||
smp_schedule_stop_proc(rp);
|
||||
assert(RTS_ISSET(rp, RTS_PROC_STOP));
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
RTS_SET(rp, RTS_PROC_STOP);
|
||||
break;
|
||||
case RC_RESUME:
|
||||
assert(RTS_ISSET(rp, RTS_PROC_STOP));
|
||||
RTS_UNSET(rp, RTS_PROC_STOP);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -140,6 +140,23 @@ PUBLIC int do_vmctl(struct proc * caller, message * m_ptr)
|
||||
return arch_phys_map_reply(m_ptr->SVMCTL_VALUE,
|
||||
(vir_bytes) m_ptr->SVMCTL_MAP_VIR_ADDR);
|
||||
}
|
||||
case VMCTL_VMINHIBIT_SET:
|
||||
/* check if we must stop a process on a different CPU */
|
||||
#if CONFIG_SMP
|
||||
if (p->p_cpu != cpuid) {
|
||||
smp_schedule_vminhibit(p);
|
||||
} else
|
||||
#endif
|
||||
RTS_SET(p, RTS_VMINHIBIT);
|
||||
return OK;
|
||||
case VMCTL_VMINHIBIT_CLEAR:
|
||||
assert(RTS_ISSET(p, RTS_VMINHIBIT));
|
||||
/*
|
||||
* the processes is certainly not runnable, no need to tell its
|
||||
* cpu
|
||||
*/
|
||||
RTS_UNSET(p, RTS_VMINHIBIT);
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* Try architecture-specific vmctls. */
|
||||
|
||||
Reference in New Issue
Block a user