Date: Fri, 3 Feb 2006 21:35:16 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 90998 for review Message-ID: <200602032135.k13LZGGX041404@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=90998 Change 90998 by jhb@jhb_slimer on 2006/02/03 21:34:55 Block in exit1() until all holds on a process are released. Affected files ... .. //depot/projects/smpng/sys/kern/kern_exit.c#109 edit .. //depot/projects/smpng/sys/sys/proc.h#161 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_exit.c#109 (text+ko) ==== @@ -175,6 +175,13 @@ p->p_flag |= P_WEXIT; + /* + * Wait for any processes that have a hold on our vmspace to + * release their reference. + */ + while (p->p_lock > 0) + msleep(&p->p_lock, &p->p_mtx, PWAIT, "exithold", 0); + PROC_LOCK(p->p_pptr); sigqueue_take(p->p_ksi); PROC_UNLOCK(p->p_pptr); ==== //depot/projects/smpng/sys/sys/proc.h#161 (text+ko) ==== @@ -785,6 +785,7 @@ } while (0) #define _PHOLD(p) do { \ PROC_LOCK_ASSERT((p), MA_OWNED); \ + KASSERT(!((p)->p_flag & P_WEXIT), ("PHOLD of exiting process"));\ (p)->p_lock++; \ if (((p)->p_sflag & PS_INMEM) == 0) \ faultin((p)); \ @@ -798,6 +799,8 @@ #define _PRELE(p) do { \ PROC_LOCK_ASSERT((p), MA_OWNED); \ (--(p)->p_lock); \ + if (((p)->p_flag & P_WEXIT) && (p)->p_lock == 0) \ + wakeup(&(p)->p_lock); \ } while (0) /* Check whether a thread is safe to be swapped out. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602032135.k13LZGGX041404>