diff options
author | Zhang Huan <zhanghuan@open-fs.com> | 2017-11-29 17:36:55 +0800 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2017-12-26 05:05:55 +0000 |
commit | f13023862edc868d4da87609412341aecd041ed8 (patch) | |
tree | fd008b460ff368b1c9ba6e28633fcf0beb5b1241 /xlators/protocol/client/src/client.h | |
parent | 0bc22bef7f3c24663aadfb3548b348aa121e3047 (diff) |
protocol/client: reduce lock contention
Current use of a per-client mutex to protect fdctx introduces lock
contentions when there are dozens of file operations active.
Use finer grain spinlock to reduce contention, and put retrieving
fdctx out of lock.
Change-Id: Iea3e2eb481e76a5d73a582ba81529180c5b88248
BUG: 1519598
Signed-off-by: Zhang Huan <zhanghuan@open-fs.com>
Diffstat (limited to 'xlators/protocol/client/src/client.h')
-rw-r--r-- | xlators/protocol/client/src/client.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/xlators/protocol/client/src/client.h b/xlators/protocol/client/src/client.h index c025b9812b7..dd3ee4dd4f0 100644 --- a/xlators/protocol/client/src/client.h +++ b/xlators/protocol/client/src/client.h @@ -145,6 +145,8 @@ typedef struct clnt_conf { struct clnt_options opt; struct rpc_clnt_config rpc_conf; struct list_head saved_fds; + pthread_spinlock_t fd_lock; /* protects saved_fds list + * and all fdctx */ pthread_mutex_t lock; int connecting; int connected; |