From: Jeffrey Altman Date: Sat, 7 Mar 2009 14:10:43 +0000 (+0000) Subject: DEVEL15-avoid-blocking-with-connhashtable-lock-in-reapconnections-20090307 X-Git-Tag: openafs-devel-1_5_58~123 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=47af594eb7b3210a418c329e64ed9ae81f4dd6c8;p=packages%2Fo%2Fopenafs.git DEVEL15-avoid-blocking-with-connhashtable-lock-in-reapconnections-20090307 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) --- diff --git a/src/rx/rx.c b/src/rx/rx.c index f354f12a1..36b0aef51 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -6068,8 +6068,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 */