Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Dec 2008 01:00:02 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Roman Divacky <rdivacky@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r185647 - in head/sys: kern sys
Message-ID:  <20081205230002.GX2038@deviant.kiev.zoral.com.ua>
In-Reply-To: <20081205224600.GA16948@freebsd.org>
References:  <200812052050.mB5KoOcV072648@svn.freebsd.org> <20081205224600.GA16948@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--tgO4DUqb0GCKXXLG
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Dec 05, 2008 at 11:46:00PM +0100, Roman Divacky wrote:
> On Fri, Dec 05, 2008 at 08:50:24PM +0000, Konstantin Belousov wrote:
> > Author: kib
> > Date: Fri Dec  5 20:50:24 2008
> > New Revision: 185647
> > URL: http://svn.freebsd.org/changeset/base/185647
> >=20
> > Log:
> >   Several threads in a process may do vfork() simultaneously. Then, all
> >   parent threads sleep on the parent' struct proc until corresponding
> >   child releases the vmspace. Each sleep is interlocked with proc mutex=
 of
> >   the child, that triggers assertion in the sleepq_add(). The assertion
> >   requires that at any time, all simultaneous sleepers for the channel =
use
> >   the same interlock.
> >  =20
> >   Silent the assertion by using conditional variable allocated in the
> >   child. Broadcast the variable event on exec() and exit().
> >  =20
> >   Since struct proc * sleep wait channel is overloaded for several
> >   unrelated events, I was unable to remove wakeups from the places where
> >   cv_broadcast() is added, except exec().
>=20
> are there any differences (performance etc.) in using condition variables
> instead of sleep/wakeup?

I do not think that there is any measurable difference. On the other
hand, the patch makes struct proc bigger by int + pointer. This shall
not be a problem too.

Would I been able to convert _all_ uses of the struct proc * wait channel
to cond vars operation, this may be measurable on some loads, since it
would exclude spurious wakeups.

--tgO4DUqb0GCKXXLG
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkk5snIACgkQC3+MBN1Mb4jlrgCeOSR6qYzMOOnwNAJPHrBIt81D
xFoAoLdHTMa7kmqMzcVYBIvLWVlUCi/j
=97eS
-----END PGP SIGNATURE-----

--tgO4DUqb0GCKXXLG--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081205230002.GX2038>