From owner-p4-projects@FreeBSD.ORG Tue May 18 16:34:55 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BEC5816A4D0; Tue, 18 May 2004 16:34:54 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9879816A4CE for ; Tue, 18 May 2004 16:34:54 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7849843D31 for ; Tue, 18 May 2004 16:34:54 -0700 (PDT) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i4INYhGe057236 for ; Tue, 18 May 2004 16:34:43 -0700 (PDT) (envelope-from julian@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i4INYgLd057233 for perforce@freebsd.org; Tue, 18 May 2004 16:34:42 -0700 (PDT) (envelope-from julian@freebsd.org) Date: Tue, 18 May 2004 16:34:42 -0700 (PDT) Message-Id: <200405182334.i4INYgLd057233@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to julian@freebsd.org using -f From: Julian Elischer To: Perforce Change Reviews Subject: PERFORCE change 53017 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 May 2004 23:34:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=53017 Change 53017 by julian@julian_desk on 2004/05/18 16:33:49 rename a function. add comments Affected files ... .. //depot/projects/nsched/sys/kern/kern_exit.c#7 edit .. //depot/projects/nsched/sys/sparc64/sparc64/vm_machdep.c#3 edit .. //depot/projects/nsched/sys/sys/proc.h#8 edit Differences ... ==== //depot/projects/nsched/sys/kern/kern_exit.c#7 (text+ko) ==== @@ -485,7 +485,7 @@ * Finally, call machine-dependent code to release the remaining * resources including address space. * The address space is released by "vmspace_exitfree(p)" in - * vm_waitproc(). + * vm_waitproc(). To be called BEFORE taking the final schedlock. */ cpu_exit(td); @@ -516,17 +516,21 @@ binuptime(PCPU_PTR(switchtime)); PCPU_SET(switchticks, ticks); - cpu_sched_exit(td); /* XXXKSE check if this should be in thread_exit */ + /* + * CPU specific things that need to be done + * after taking the final schedlock before calling cpu_throw(). + * Currently only used on sparc64. + */ + cpu_exit2(td); + /* * Allow the scheduler to adjust the priority of the * parent when a process is exiting. */ - if (p->p_pptr != initproc) - sched_exit(p->p_pptr, td); + sched_exit(p->p_pptr, td); /* - * Make sure the scheduler takes this thread out of its tables etc. - * This will also release this thread's reference to the ucred. + * Make sure the system takes this thread out of its tables etc. * Other thread parts to release include pcb bits and such. */ thread_exit(); ==== //depot/projects/nsched/sys/sparc64/sparc64/vm_machdep.c#3 (text+ko) ==== @@ -120,8 +120,17 @@ } } +/* + * Must be called after the final schedlock has been + * procured in the glidepath for thread/process destruction. + * This removes some values checked by the optimisation that allows + * the change of vmspace to be short-circuited in some cases. + * by making these values NULL the switch() code will be + * forced to load a new vmspace in each cpu, thus making this one + * free for recycling etc. + */ void -cpu_sched_exit(struct thread *td) +cpu_exit2(struct thread *td) { struct vmspace *vm; struct pcpu *pc; ==== //depot/projects/nsched/sys/sys/proc.h#8 (text+ko) ==== @@ -787,7 +787,7 @@ void userret(struct thread *, struct trapframe *, u_int); void cpu_exit(struct thread *); -void cpu_sched_exit(struct thread *); +void cpu_exit2(struct thread *); void exit1(struct thread *, int) __dead2; void cpu_fork(struct thread *, struct proc *, struct thread *, int); void cpu_set_fork_handler(struct thread *, void (*)(void *), void *);