]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-avoid-blocking-with-connhashtable-lock-in-reapconnections-20090307
authorJeffrey Altman <jaltman@your-file-system.com>
Sat, 7 Mar 2009 14:11:01 +0000 (14:11 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sat, 7 Mar 2009 14:11:01 +0000 (14:11 +0000)
LICENSE BSD

instead of potentially blocking waiting for a call lock, assume if the call is
locked, the conn is still busy. also, don't even try to get the conn data lock
if we don't need to

(cherry picked from commit 581fd18bd9c3fe8e07169c60a7cde9e72e8af89c)

src/rx/rx.c

index c16aec29daa4b7973d625e829355c94893c23ff1..94a9395473d9f18aa5a6469cd1e8aebc635dad19 100644 (file)
@@ -5789,8 +5789,11 @@ rxi_ReapConnections(void)
                for (i = 0; i < RX_MAXCALLS; i++) {
                    call = conn->call[i];
                    if (call) {
+                       int code;
                        havecalls = 1;
-                       MUTEX_ENTER(&call->lock);
+                       code = MUTEX_TRYENTER(&call->lock);
+                       if (!code)
+                           continue;
 #ifdef RX_ENABLE_LOCKS
                        result = rxi_CheckCall(call, 1);
 #else /* RX_ENABLE_LOCKS */