Rx: prevent rx_rpc_stats mutex from being a global bottleneck
authorJeffrey Altman <jaltman@your-file-system.com>
Sun, 9 May 2010 01:38:05 +0000 (21:38 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Wed, 12 May 2010 05:29:02 +0000 (22:29 -0700)
commit34b0fef60a555de11590631fce1e92454457fc72
tree7748c6de294ad6a25ffd90fc3ab6805b6c610ec1
parentf793bc07e12b86561bc05eab9eb37dda55d792f5
Rx: prevent rx_rpc_stats mutex from being a global bottleneck

Prior to this patchset, the 'rx_rpc_stats' mutex was superior
to both the 'peer->peer_lock' and the 'rx_peerHashTable_lock'.
That meant that the 'rx_rpc_stats' was being held across many
operations that walk the peer hash table.  For example,
rxi_ReapConnections, rx_disablePeerRPCStats, and rx_shutdown.
Since every RPC issues a call to rx_IncrementTimeAndCount, the
reap connections event would effectively bring all RPC processing
to a halt.

This patchset moves 'rx_rpc_stats' later in the hierarchy and
restructures rxi_ReapConnections, rx_disablePeerRPCStats, and
rx_shutdown so that not only doesn't the 'rx_rpc_stats' mutex
need to be held across the entire function but the
'rx_peerHashTable_lock' does not need to be held while complex
operations on the peer object are taking place.

rxi_ReceiveDebugPacket is also fixed to hold the rx_peerHashTable_lock
and peer_lock at appropriate times while completing its function.

Change-Id: I1a11798f1bb2a8f03316c6c455954bd6b8d1459b
Reviewed-on: http://gerrit.openafs.org/1928
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
src/rx/rx.c
src/rx/rx_packet.c