vm->exiting: deal with exit_group() and concurrent page faults

This commit is contained in:
Balazs Gerofi
2015-03-22 18:04:12 +09:00
committed by Balazs Gerofi
parent fbb776e4fb
commit 4ebe778ede
4 changed files with 27 additions and 2 deletions

View File

@@ -370,10 +370,25 @@ static void page_fault_handler(void *fault_addr, uint64_t reason, void *regs)
dkprintf("[%d]page_fault_handler(%p,%lx,%p)\n",
ihk_mc_get_processor_id(), fault_addr, reason, regs);
cpu_enable_interrupt();
error = page_fault_process_vm(proc->vm, fault_addr, reason);
if (error) {
struct siginfo info;
if (error == -ECANCELED) {
kprintf("process is exiting, terminate.\n");
ihk_mc_spinlock_lock_noirq(&proc->ftn->lock);
proc->ftn->status = PS_ZOMBIE;
ihk_mc_spinlock_unlock_noirq(&proc->ftn->lock);
release_fork_tree_node(proc->ftn->parent);
release_fork_tree_node(proc->ftn);
//release_process(proc);
schedule();
}
kprintf("[%d]page_fault_handler(%p,%lx,%p):"
"fault vm failed. %d\n",
ihk_mc_get_processor_id(), fault_addr,