Date: Wed, 8 Feb 2006 16:29:35 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 91396 for review Message-ID: <200602081629.k18GTZWF001942@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=91396 Change 91396 by jhb@jhb_slimer on 2006/02/08 16:28:49 Don't block waiting on _PRELE's until after we've woken up any procfs waiters. Affected files ... .. //depot/projects/smpng/sys/kern/kern_exit.c#110 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_exit.c#110 (text+ko) ==== @@ -175,13 +175,6 @@ 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); @@ -205,7 +198,21 @@ PROC_LOCK(p); _STOPEVENT(p, S_EXIT, rv); - wakeup(&p->p_stype); /* Wakeup anyone in procfs' PIOCWAIT */ + + /* + * Wakeup anyone in procfs' PIOCWAIT. They should have a hold + * on our vmspace, so we should block below until they have + * released their reference to us. + */ + wakeup(&p->p_stype); + + /* + * 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_UNLOCK(p); /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602081629.k18GTZWF001942>