svn commit: r185647 - in head/sys: kern sys

M. Warner Losh imp at bsdimp.com
Sat Dec 6 19:23:59 PST 2008


In message: <20081205230002.GX2038 at deviant.kiev.zoral.com.ua>
            Kostik Belousov <kostikbel at 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


More information about the svn-src-all mailing list