vm->exiting: deal with exit_group() and concurrent page faults
This commit is contained in:
committed by
Balazs Gerofi
parent
fbb776e4fb
commit
4ebe778ede
15
kernel/mem.c
15
kernel/mem.c
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user