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

src/rx/rx.c

index 70649e2f007239a5fab2c128b5e5c1e4f111d86a..e141d63850d2116d22ec9d1479a6d2e394592396 100644 (file)
@@ -6093,8 +6093,11 @@ rxi_ReapConnections(struct rxevent *unused, void *unused1, void *unused2)
                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 */