rx: Make statistics interface use Atomics
authorSimon Wilkinson <sxw@your-file-system.com>
Tue, 28 Sep 2010 23:11:53 +0000 (00:11 +0100)
committerJeffrey Altman <jaltman@openafs.org>
Thu, 30 Sep 2010 13:10:05 +0000 (06:10 -0700)
commit37946ee1739aa22cb2f7330a37504d33a7733c9a
tree5defce3418a65b381f5cbeb5489cb3e71286677a
parent1676c7e54f238e72910263f83987b271067efe21
rx: Make statistics interface use Atomics

Make the rx_statistics statistics gathering infrastructure use
atomics for all of its counters. This significantly reduces
lock contention. However, it also (potentially) changes the format
of the rx_stats variable which has been used by callers in the past.

To simplify this process, and to aid with future changes, we remove
direct access to rx_stats. Instead, two additional API functions
rx_GetStatistics and rx_FreeStatistics are provided. These give the
caller access to an 'normal' rx_statistics structure.

Tom Keiser has suggested that we should explore using thread-local
statistics structures, and just aggregating them when we are asked
to report. This is a fine idea, and is equally possible with the
new interface that this patch introduces.

Change-Id: I859cea8f7354a655be007b95fa8a61f995308b35
Reviewed-on: http://gerrit.openafs.org/2862
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
19 files changed:
src/libafsrpc/Makefile.in
src/libafsrpc/NTMakefile
src/libafsrpc/afsrpc.def
src/libuafs/Makefile.common.in
src/rx/Makefile.in
src/rx/NTMakefile
src/rx/rx.c
src/rx/rx.h
src/rx/rx_globals.h
src/rx/rx_kcommon.c
src/rx/rx_lwp.c
src/rx/rx_packet.c
src/rx/rx_prototypes.h
src/rx/rx_stats.c [new file with mode: 0644]
src/rx/rx_stats.h [new file with mode: 0644]
src/rx/rx_user.c
src/shlibafsrpc/Makefile.in
src/shlibafsrpc/libafsrpc.map
src/viced/afsfileprocs.c