Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Dec 2008 12:26:20 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        svn-src-head@freebsd.org, rdivacky@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org
Subject:   Re: svn commit: r185647 - in head/sys: kern sys
Message-ID:  <20081207102620.GK2038@deviant.kiev.zoral.com.ua>
In-Reply-To: <20081206.202344.-160243400.imp@bsdimp.com>
References:  <200812052050.mB5KoOcV072648@svn.freebsd.org> <20081205224600.GA16948@freebsd.org> <20081205230002.GX2038@deviant.kiev.zoral.com.ua> <20081206.202344.-160243400.imp@bsdimp.com>

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

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

On Sat, Dec 06, 2008 at 08:23:44PM -0700, M. Warner Losh wrote:
> In message: <20081205230002.GX2038@deviant.kiev.zoral.com.ua>
>             Kostik Belousov <kostikbel@gmail.com> writes:
> : 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 correspondi=
ng
> : > >   child releases the vmspace. Each sleep is interlocked with proc m=
utex of
> : > >   the child, that triggers assertion in the sleepq_add(). The asser=
tion
> : > >   requires that at any time, all simultaneous sleepers for the chan=
nel use
> : > >   the same interlock.
> : > >  =20
> : > >   Silent the assertion by using conditional variable allocated in t=
he
> : > >   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 varia=
bles
> : > instead of sleep/wakeup?
> :=20
> : 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.
> :=20
> : Would I been able to convert _all_ uses of the struct proc * wait chann=
el
> : to cond vars operation, this may be measurable on some loads, since it
> : would exclude spurious wakeups.
>=20
> Is that a measurable good difference, or a measurable bad difference?

I expect this could be measurable good difference, i.e. such patch might
improve performance on some loads by eliminating false wakeups.

--9SzJfJEKNI6APITJ
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iEYEARECAAYFAkk7pMsACgkQC3+MBN1Mb4iETgCfX2qVnP2e+1gPG2HBrwspv+HV
EtoAoMuhcsgY0JbRg3gnuTQ3zvSmU0Af
=jhP7
-----END PGP SIGNATURE-----

--9SzJfJEKNI6APITJ--



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