diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 3f1280129c0..2f8b4df28ba 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -153,6 +153,8 @@ proc_dtor(void *mem, int size, void *arg) #ifdef INVARIANTS KASSERT((p->p_numthreads == 1), ("bad number of threads in exiting process")); + KASSERT((p->p_numksegrps == 1), ("free proc with > 1 ksegrp")); + td = FIRST_THREAD_IN_PROC(p); KASSERT((td != NULL), ("proc_dtor: bad thread pointer")); kg = FIRST_KSEGRP_IN_PROC(p); KASSERT((kg != NULL), ("proc_dtor: bad kg pointer")); @@ -190,27 +192,14 @@ proc_init(void *mem, int size, int flags) } /* - * Tear down type-stable parts of a proc (just before being discarded) + * UMA should ensure that this function is never called. + * Freeing a proc structure would violate type stability. */ static void proc_fini(void *mem, int size) { - struct proc *p; - struct thread *td; - struct ksegrp *kg; - p = (struct proc *)mem; - KASSERT((p->p_numthreads == 1), - ("bad number of threads in freeing process")); - td = FIRST_THREAD_IN_PROC(p); - KASSERT((td != NULL), ("proc_fini: bad thread pointer")); - kg = FIRST_KSEGRP_IN_PROC(p); - KASSERT((kg != NULL), ("proc_fini: bad kg pointer")); - vm_proc_dispose(p); - sched_destroyproc(p); - thread_free(td); - ksegrp_free(kg); - mtx_destroy(&p->p_mtx); + panic("proc reclaimed"); } /* diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index ee04bf36ab9..787ec459d53 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -784,22 +784,6 @@ sched_newproc(struct proc *p, struct ksegrp *kg, struct thread *td) sched_init_concurrency(kg); } -/* - * Called by the uma process fini routine.. - * undo anything we may have done in the uma_init method. - * Panic if it's not all 1:1:1:1 - * Called from: - * proc_fini() (UMA method) - */ -void -sched_destroyproc(struct proc *p) -{ - - /* this function slated for destruction */ - KASSERT((p->p_numthreads == 1), ("Cached proc with > 1 thread ")); - KASSERT((p->p_numksegrps == 1), ("Cached proc with > 1 ksegrp ")); -} - #define RANGEOF(type, start, end) (offsetof(type, end) - offsetof(type, start)) /* * thread is being either created or recycled. diff --git a/sys/sys/sched.h b/sys/sys/sched.h index 8d228572da5..38dd125d726 100644 --- a/sys/sys/sched.h +++ b/sys/sys/sched.h @@ -108,11 +108,11 @@ sched_unpin(void) /* temporarily here */ void schedinit(void); -void sched_destroyproc(struct proc *p); void sched_init_concurrency(struct ksegrp *kg); void sched_set_concurrency(struct ksegrp *kg, int cuncurrency); void sched_schedinit(void); void sched_newproc(struct proc *p, struct ksegrp *kg, struct thread *td); void sched_thread_exit(struct thread *td); void sched_newthread(struct thread *td); + #endif /* !_SYS_SCHED_H_ */ diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 9d5fa42e100..af0ed3e249d 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -282,7 +282,10 @@ vm_proc_new(struct proc *p) /* * Dispose the U area for a process that has exited. * This routine directly impacts the exit perf of a process. - * XXX proc_zone is marked UMA_ZONE_NOFREE, so this should never be called. + * + * XXX UNUSED + * U areas of free proc structures are no longer freed and are never + * swapped out. Ideally we would free U areas lazily, when low on memory. */ void vm_proc_dispose(struct proc *p)