Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 06 Dec 2008 20:23:44 -0700 (MST)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        kostikbel@gmail.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:  <20081206.202344.-160243400.imp@bsdimp.com>
In-Reply-To: <20081205230002.GX2038@deviant.kiev.zoral.com.ua>
References:  <200812052050.mB5KoOcV072648@svn.freebsd.org> <20081205224600.GA16948@freebsd.org> <20081205230002.GX2038@deviant.kiev.zoral.com.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
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
: > > 
: > > 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.
: > >   
: > >   Silent the assertion by using conditional variable allocated in the
: > >   child. Broadcast the variable event on exec() and exit().
: > >   
: > >   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().
: > 
: > 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.

Is that a measurable good difference, or a measurable bad difference?

Warner



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