From owner-svn-src-head@FreeBSD.ORG Sun Dec 7 10:26:26 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BD27106564A; Sun, 7 Dec 2008 10:26:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 2A8A28FC18; Sun, 7 Dec 2008 10:26:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1L9GqF-0001QD-TC; Sun, 07 Dec 2008 12:26:23 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id mB7AQKhM025327 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 7 Dec 2008 12:26:20 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id mB7AQK9Z074739; Sun, 7 Dec 2008 12:26:20 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id mB7AQKxi074738; Sun, 7 Dec 2008 12:26:20 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 7 Dec 2008 12:26:20 +0200 From: Kostik Belousov To: "M. Warner Losh" Message-ID: <20081207102620.GK2038@deviant.kiev.zoral.com.ua> References: <200812052050.mB5KoOcV072648@svn.freebsd.org> <20081205224600.GA16948@freebsd.org> <20081205230002.GX2038@deviant.kiev.zoral.com.ua> <20081206.202344.-160243400.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9SzJfJEKNI6APITJ" Content-Disposition: inline In-Reply-To: <20081206.202344.-160243400.imp@bsdimp.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1L9GqF-0001QD-TC 1335506a674f49f83f1572321f12c0d1 X-Terabit: YES 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Dec 2008 10:26:26 -0000 --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 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--