diff options
| author | Chuck Lever <chuck.lever@oracle.com> | 2014-11-08 20:15:09 -0500 |
|---|---|---|
| committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2014-11-25 16:22:15 -0500 |
| commit | edef1297f33a4546559d905457b435a5ea160bab (patch) | |
| tree | c14a3b6d62e72cb8b46a3a8cc09679b343831b49 /include/linux | |
| parent | 5d01410fe4d92081f349b013a2e7a95429e4f2c9 (diff) | |
SUNRPC: serialize iostats updates
Occasionally mountstats reports a negative retransmission rate.
Ensure that two RPCs completing concurrently don't confuse the sums
in the transport's op_metrics array.
Since pNFS filelayout can invoke rpc_count_iostats() on another
transport from xprt_release(), we can't rely on simply holding the
transport_lock in xprt_release(). There's nothing for it but hard
serialization. One spin lock per RPC operation should make this as
painless as it can be.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/sunrpc/metrics.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/sunrpc/metrics.h b/include/linux/sunrpc/metrics.h index 1565bbe86d51..eecb5a71e6c0 100644 --- a/include/linux/sunrpc/metrics.h +++ b/include/linux/sunrpc/metrics.h | |||
| @@ -27,10 +27,13 @@ | |||
| 27 | 27 | ||
| 28 | #include <linux/seq_file.h> | 28 | #include <linux/seq_file.h> |
| 29 | #include <linux/ktime.h> | 29 | #include <linux/ktime.h> |
| 30 | #include <linux/spinlock.h> | ||
| 30 | 31 | ||
| 31 | #define RPC_IOSTATS_VERS "1.0" | 32 | #define RPC_IOSTATS_VERS "1.0" |
| 32 | 33 | ||
| 33 | struct rpc_iostats { | 34 | struct rpc_iostats { |
| 35 | spinlock_t om_lock; | ||
| 36 | |||
| 34 | /* | 37 | /* |
| 35 | * These counters give an idea about how many request | 38 | * These counters give an idea about how many request |
| 36 | * transmissions are required, on average, to complete that | 39 | * transmissions are required, on average, to complete that |
