From owner-freebsd-emulation@FreeBSD.ORG Wed Feb 18 14:12:40 2009 Return-Path: Delivered-To: freebsd-emulation@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F6EA106566B for ; Wed, 18 Feb 2009 14:12:40 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 0A1B18FC1A for ; Wed, 18 Feb 2009 14:12:39 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 5E5F39CB084; Wed, 18 Feb 2009 15:09:38 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rlCsyUYXTJuh; Wed, 18 Feb 2009 15:09:36 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 300829CB113; Wed, 18 Feb 2009 15:09:36 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n1IE9an2053056; Wed, 18 Feb 2009 15:09:36 +0100 (CET) (envelope-from rdivacky) Date: Wed, 18 Feb 2009 15:09:36 +0100 From: Roman Divacky To: Takahiro Kurosawa Message-ID: <20090218140936.GA52973@freebsd.org> References: <200902181410.n1IEA5Vq060807@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200902181410.n1IEA5Vq060807@freefall.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-emulation@FreeBSD.org Subject: Re: kern/131506: pipes in forked procs sometimes hang under Linux emulation 2.6.16 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 14:12:40 -0000 On Wed, Feb 18, 2009 at 02:10:05PM +0000, Takahiro Kurosawa wrote: > The following reply was made to PR kern/131506; it has been noted by GNATS. > > From: Takahiro Kurosawa > To: Kostik Belousov > Cc: bug-followup@freebsd.org > Subject: Re: kern/131506: pipes in forked procs sometimes hang under Linux > emulation 2.6.16 > Date: Wed, 18 Feb 2009 23:08:05 +0900 > > 2009/2/18 Kostik Belousov : > > > Please, resend the patch without base64-encoding, best as a plain/text > > attachment. > > Sure. Sending the patch inline... > The attachment of my previous mail looks broken to me too. > > === sys/amd64/linux32/linux32_machdep.c > ================================================================== > --- sys/amd64/linux32/linux32_machdep.c (revision 188741) > +++ sys/amd64/linux32/linux32_machdep.c (local) > @@ -560,7 +560,7 @@ > /* wait for the children to exit, ie. emulate vfork */ > PROC_LOCK(p2); > while (p2->p_flag & P_PPWAIT) > - msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0); > + cv_wait(&p2->p_pwait, &p2->p_mtx); > PROC_UNLOCK(p2); > > return (0); > @@ -749,7 +749,7 @@ > /* wait for the children to exit, ie. emulate vfork */ > PROC_LOCK(p2); > while (p2->p_flag & P_PPWAIT) > - msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0); > + cv_wait(&p2->p_pwait, &p2->p_mtx); > PROC_UNLOCK(p2); > } > > === sys/i386/linux/linux_machdep.c > ================================================================== > --- sys/i386/linux/linux_machdep.c (revision 188741) > +++ sys/i386/linux/linux_machdep.c (local) > @@ -376,7 +376,7 @@ > /* wait for the children to exit, ie. emulate vfork */ > PROC_LOCK(p2); > while (p2->p_flag & P_PPWAIT) > - msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0); > + cv_wait(&p2->p_pwait, &p2->p_mtx); > PROC_UNLOCK(p2); > > return (0); > @@ -581,7 +581,7 @@ > /* wait for the children to exit, ie. emulate vfork */ > PROC_LOCK(p2); > while (p2->p_flag & P_PPWAIT) > - msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0); > + cv_wait(&p2->p_pwait, &p2->p_mtx); > PROC_UNLOCK(p2); > } looks correct to me... fork1() indeed uses cv_wait() instead of msleep(). it should be changed to cv_wait