[OpenAFS-devel] crfree() and locking

Rainer Toebbicke rtb@pclella.cern.ch
Fri, 07 Dec 2007 10:32:09 +0100


Hi all,

I'm currently looking into locking issues in some high-frequency paths 
in osi_vnodeops.c causing major performance drops on multi-way nodes.

What I get confused about is crfree(): it is frequently (almost 
systematically) called after releasing the AFS global lock, mimicking 
crref() which obviously is better outside the global lock.

Is this actually correct? The creds are passed to higher level 
routines. What if any of those increments the reference count and 
correspondingly cares about a crfree() later which would decrement the 
reference count? Then we could be faced with a counter being 
decremented outside a lock - I don't see how this could be guaranteed 
to happen only sequentially.

Incrementing cr_ref happens BTW: in DARWIN/osi_file.c for example.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Rainer Toebbicke
European Laboratory for Particle Physics(CERN) - Geneva, Switzerland
Phone: +41 22 767 8985       Fax: +41 22 767 7155