Date: Tue, 18 May 2004 16:34:42 -0700 (PDT) From: Julian Elischer <julian@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 53017 for review Message-ID: <200405182334.i4INYgLd057233@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 *);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200405182334.i4INYgLd057233>