sunrpc: fix potential races in pool_stats collection

In a later patch, we'll be removing some spinlocking around the socket
and thread queueing code in order to fix some contention problems. At
that point, the stats counters will no longer be protected by the
sp_lock.

Change the counters to atomic_long_t fields, except for the
"sockets_queued" counter which will still be manipulated under a
spinlock.

Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Tested-by: Chris Worley <chris.worley@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
Jeff Layton
2014-11-21 14:19:29 -05:00
committed by J. Bruce Fields
parent 812443865c
commit 403c7b4444
2 changed files with 9 additions and 9 deletions

View File

@@ -26,10 +26,10 @@ typedef int (*svc_thread_fn)(void *);
/* statistics for svc_pool structures */
struct svc_pool_stats {
unsigned long packets;
atomic_long_t packets;
unsigned long sockets_queued;
unsigned long threads_woken;
unsigned long threads_timedout;
atomic_long_t threads_woken;
atomic_long_t threads_timedout;
};
/*