OpenAFS CVS Commit: openafs/src/WINNT/afsd by jaltman

cvs@GRAND.CENTRAL.ORG cvs@GRAND.CENTRAL.ORG
Sat, 03 Nov 2007 12:31:50 EDT


Update of /cvs/openafs/src/WINNT/afsd
In directory GRAND.CENTRAL.ORG:/home/jaltman/openafs/cvs-1-3/src/WINNT/afsd

Modified Files:
	cm_scache.c cm_scache.h 
Log Message:
DELTA windows-scache-syncop-waiters-20071103
AUTHOR asanka@secure-endpoints.com

One of the issues that has become a serious problem since the addition
of the local directory updates is that although cm_SyncOp synchronizes
operations, it does not preserve the order of requests.  This has always
been a problem in that it has been possible for a request to fail to 
complete due to its worker thread's bad luck.  When a request takes
longer than the Windows SMB Redirector's timeout, the SMB Redirector 
tears down the SMB virtual circuit.  

When using the local directory updates it is really important that 
the directory update operations complete in the order that they were
sent to the file server.  If they don't, then the local directory
state and the file server state will not match and the local directory
state must be discarded which in turn forces a new read of the entire
directory contents over the network.

This patch adds a new cm_scache_waiter_t object that is used to store
the current thread, buffer, and syncop flags within a waiters queue
on each cm_scache_t object.  If a thread is forced to sleep in cm_SyncOp,
upon waking it will check to see if there are any other threads waiting
that are attempting to perform a similar task ahead of it in the queue.
If yes, the thread goes back to sleep.  If not, it goes ahead and 
enters the cm_SyncOp conflict resolution block.

This patch has the additional side effect of reducing the number of
competing threads that must obtain the cm_scache_t mutex and process
the cm_SyncOp conflict resolution block.  As a result, the overall 
CPU utilization of the service and the clock time associated with 
processing requests will be reduced.





--- DELTA config follows ---
windows-scache-syncop-waiters-20071103 openafs/src/WINNT/afsd/cm_scache.c 1.80 1.81
windows-scache-syncop-waiters-20071103 openafs/src/WINNT/afsd/cm_scache.h 1.37 1.38