Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Oct 2004 14:17:14 -0700 (PDT)
From:      Don Lewis <truckman@FreeBSD.org>
To:        ssouhlal@FreeBSD.org
Cc:        freebsd-arch@FreeBSD.org
Subject:   Re: [RFC] sysctl locking
Message-ID:  <200410132117.i9DLHEKS076320@gw.catspoiler.org>
In-Reply-To: <1C45EA64-1D5B-11D9-A525-000A95C4D7BC@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 13 Oct, Suleiman Souhlal wrote:
> Hi,
> 
> On Oct 11, 2004, at 3:30 PM, Don Lewis wrote:
>> There seems to be a lot of locking/unlocking overhead in the oid lookup
>> and oid tree manipulation code.  Doing the traversals at each level of
>> the tree without holding a lock for the entire time makes me nervous,
>> though I can't point to any specific problem.  It might be better to
>> just hold a single lock across then entire lookup, insertion, or
>> deletion operation.
> 
> Thanks for your reply! I think you are right. It would also make the 
> locking much simpler. However, there is the problem that sysctl 
> handlers can sleep, so we shouldn't be holding a mutex when calling 
> them..

Unlock the mutex after doing the lookup and getting ownership of the
oid, and before calling the handler.



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