From owner-p4-projects@FreeBSD.ORG Wed Feb 8 16:29:36 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 15A9816A423; Wed, 8 Feb 2006 16:29:36 +0000 (GMT) X-Original-To: perforce@freebsd.org 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 E49B616A420 for ; Wed, 8 Feb 2006 16:29:35 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AFFE743D45 for ; Wed, 8 Feb 2006 16:29:35 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k18GTZJO001945 for ; Wed, 8 Feb 2006 16:29:35 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k18GTZWF001942 for perforce@freebsd.org; Wed, 8 Feb 2006 16:29:35 GMT (envelope-from jhb@freebsd.org) Date: Wed, 8 Feb 2006 16:29:35 GMT Message-Id: <200602081629.k18GTZWF001942@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 91396 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2006 16:29:37 -0000 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); /*