Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jun 2004 18:12:10 -0700
From:      Alfred Perlstein <alfred@freebsd.org>
To:        Daniel Eischen <eischen@vigrid.com>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/amd64/conf GENERIC
Message-ID:  <20040615011210.GN61448@elvis.mu.org>
In-Reply-To: <Pine.GSO.4.10.10406141552260.20667-100000@pcnet5.pcnet.com>
References:  <20040614194836.GJ61448@elvis.mu.org> <Pine.GSO.4.10.10406141552260.20667-100000@pcnet5.pcnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* Daniel Eischen <eischen@vigrid.com> [040614 13:09] wrote:
> On Mon, 14 Jun 2004, Alfred Perlstein wrote:
> 
> >  DbEnv::set_tas_spins
> > 
> >    Specify that test-and-set mutexes should spin tas_spins times without
> >    blocking. The value defaults to 1 on uniprocessor systems and to 50
> >    times the number of processors on multiprocessor systems.
> > 
> >    The database environment's test-and-set spin count may also be set
> >    using the environment's DB_CONFIG file. The syntax of the entry in
> >    that file is a single line with the string "set_tas_spins", one or
> >    more whitespace characters, and the number of spins. Because the
> >    DB_CONFIG file is read when the database environment is opened, it
> >    will silently overrule configuration done before that time.
> 
> I think you're missing his point.  Adaptive mutexes _do_ spin.
> The optimization is that they spin for only as long as the
> current owner is running (on another CPU).  If the owner is
> not running or stops running, the thread blocks.
> 
> The kernel knows about its threads, which thread owns a
> mutex, and whether that thread is running.  And since
> the desire is for mutexes to be held for short periods, it
> is better for the requesting thread to spin as long as the
> owning thread is running.  And conversely, it doesn't make
> sense to spin if the owning thread isn't running.

I understand what you're saying.  It's just that it seems that
we now have some subsystem locks where spinning as long as the
holder is running might be too long.

I said "might" I didn't say "will".

It might be interesting to put an upper bound on the amount of
spins.

Anyhow. :)

-- 
- Alfred Perlstein
- Research Engineering Development Inc.
- email: bright@mu.org cell: 408-480-4684



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