From 5fd85f53f26ba1f0649b8a8c68d3abb1c5159eb9 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 18 Feb 2008 17:27:48 +0000 Subject: [PATCH] rx-stats-optimization-20080218 LICENSE IPL10 Do not grab the peer mutex or the rpc stats mutex if we are not intending to collect stats. Doing so is a bottleneck. --- src/rx/rx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rx/rx.c b/src/rx/rx.c index 946aa33ec4..abd4f06f3d 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -7090,6 +7090,9 @@ rx_IncrementTimeAndCount(struct rx_peer *peer, afs_uint32 rxInterface, int isServer) { + if (!(rxi_monitor_peerStats || rxi_monitor_processStats)) + return; + MUTEX_ENTER(&rx_rpc_stats); MUTEX_ENTER(&peer->peer_lock);