Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Apr 2004 13:32:20 -0400
From:      John Baldwin <jhb@FreeBSD.org>
To:        Jeff Roberson <jroberson@chesapeake.net>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/conf options src/sys/kern kern_mutex.c
Message-ID:  <200404071332.20846.jhb@FreeBSD.org>
In-Reply-To: <20040406234035.U72393@mail.chesapeake.net>
References:  <200404061912.i36JCP1m036228@repoman.freebsd.org> <20040406234035.U72393@mail.chesapeake.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 06 April 2004 11:41 pm, Jeff Roberson wrote:
> On Tue, 6 Apr 2004, John Baldwin wrote:
> > jhb         2004/04/06 12:12:25 PDT
> >
> >   FreeBSD src repository
> >
> >   Modified files:
> >     sys/conf             options
> >     sys/kern             kern_mutex.c
> >   Log:
> >   Add a new kernel option MUTEX_WAKE_ALL that changes the mutex unlock
> > code to awaken all waiters when a contested mutex is released instead of
> > just the highest priority waiter.  If the various threads are awakened in
> > sequence then each thread may acquire and release the lock in question
> > without contention resulting in fewer expensive unlock and lock
> > operations.  This old behavior of waking just the highest priority is
> > still used if this option is specified.  Making the algorithm conditional
> > on a kernel option will allows us to benchmark both cases later and
> > determine which one should be used by default.
>
> This seems like an optimization on UP and a pessimization on SMP.  Perhaps
> you should make it conditional on mp_ncpus?

Sun found it to be an optimization in general, and they tend to have a lot of 
very MP SMP boxes. :)  It is a kernel option specifically so we can benchmark 
it for various test cases.  I wouldn't mind having different defaults based 
on #ifdef SMP, but I'd rather avoid any run-time checks.

-- 
John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



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