Date: Wed, 18 Feb 2009 15:09:36 +0100 From: Roman Divacky <rdivacky@FreeBSD.org> To: Takahiro Kurosawa <takahiro.kurosawa@gmail.com> Cc: freebsd-emulation@FreeBSD.org Subject: Re: kern/131506: pipes in forked procs sometimes hang under Linux emulation 2.6.16 Message-ID: <20090218140936.GA52973@freebsd.org> In-Reply-To: <200902181410.n1IEA5Vq060807@freefall.freebsd.org> References: <200902181410.n1IEA5Vq060807@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <takahiro.kurosawa@gmail.com> > To: Kostik Belousov <kostikbel@gmail.com> > 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 <kostikbel@gmail.com>: > > > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090218140936.GA52973>