diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2000-06-05 11:03:06 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2000-06-05 11:03:06 +0000 |
commit | a9373777186bac0acc8148d4108429a9fc82c3c7 (patch) | |
tree | 42ea358aca2501d0078055c9026a71cb55ab667c /sys/arch/i386 | |
parent | 7f0672f1404b8202f54f66098bec7fd4b3e6725b (diff) |
Changes to exit handling.
cpu_exit no longer frees the vmspace and u-area. This is now handled by a
separate kernel thread "reaper". This is to avoid sleeping locks in the
critical path of cpu_exit where we're not allowed to sleep.
From NetBSD
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/i386/locore.s | 26 | ||||
-rw-r--r-- | sys/arch/i386/i386/vm_machdep.c | 33 |
2 files changed, 22 insertions, 37 deletions
diff --git a/sys/arch/i386/i386/locore.s b/sys/arch/i386/i386/locore.s index 5600f8c33c3..05c0f3dc1c0 100644 --- a/sys/arch/i386/i386/locore.s +++ b/sys/arch/i386/i386/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.50 2000/05/01 00:43:41 mickey Exp $ */ +/* $OpenBSD: locore.s,v 1.51 2000/06/05 11:02:54 art Exp $ */ /* $NetBSD: locore.s,v 1.145 1996/05/03 19:41:19 christos Exp $ */ /*- @@ -1943,24 +1943,12 @@ ENTRY(switch_exit) /* Interrupts are okay again. */ sti - /* Thoroughly nuke the old process's resources. */ - pushl P_ADDR(%edi) - call _tss_free - pushl P_VMSPACE(%edi) -#if defined(UVM) - call _C_LABEL(uvmspace_free) -#else - call _vmspace_free -#endif - pushl $USPACE - pushl P_ADDR(%edi) - pushl _kernel_map -#if defined(UVM) - call _C_LABEL(uvm_km_free) -#else - call _kmem_free -#endif - addl $20,%esp + /* + * Schedule the dead process's vmspace and stack to be freed. + */ + pushl %edi /* exit2(p) */ + call _C_LABEL(exit2) + addl $4,%esp /* Jump into cpu_switch() with the right state. */ movl %ebx,%esi diff --git a/sys/arch/i386/i386/vm_machdep.c b/sys/arch/i386/i386/vm_machdep.c index 78c3e5fa531..5ba85422128 100644 --- a/sys/arch/i386/i386/vm_machdep.c +++ b/sys/arch/i386/i386/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.17 1999/08/17 10:32:16 niklas Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.18 2000/06/05 11:02:54 art Exp $ */ /* $NetBSD: vm_machdep.c,v 1.61 1996/05/03 19:42:35 christos Exp $ */ /*- @@ -206,29 +206,12 @@ void cpu_exit(p) register struct proc *p; { -#ifdef USER_LDT - struct pcb *pcb; -#endif - struct vmspace *vm; - #if NNPX > 0 /* If we were using the FPU, forget about it. */ if (npxproc == p) npxproc = 0; #endif -#ifdef USER_LDT - pcb = &p->p_addr->u_pcb; - if (pcb->pcb_flags & PCB_USER_LDT) - i386_user_cleanup(pcb); -#endif - - vm = p->p_vmspace; -#if !defined(UVM) - if (vm->vm_refcnt == 1) - vm_map_remove(&vm->vm_map, VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS); -#endif - #if defined(UVM) uvmexp.swtch++; #else @@ -237,6 +220,20 @@ cpu_exit(p) switch_exit(p); } +void +cpu_wait(p) + struct proc *p; +{ + struct pcb *pcb; + + pcb = &p->p_addr->u_pcb; +#ifdef USER_LDT + if (pcb->pcb_flags & PCB_USER_LDT) + i386_user_cleanup(pcb); +#endif + tss_free(pcb); +} + /* * Dump the machine specific segment at the start of a core dump. */ |