summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorMohit Agrawal <moagrawa@redhat.com>2020-07-27 18:08:00 +0530
committergluster-ant <bugzilla-bot@gluster.org>2020-07-27 18:08:00 +0530
commit3c9d5578a623ed1da20e435ddb1283f7b1e7e965 (patch)
tree6459211f8203ac2ae111bd992dd67aae3b1e34cf /libglusterfs
parent0f61678b809f764290b43542fd9a00e93c59448a (diff)
downloadglusterfs-3c9d5578a623ed1da20e435ddb1283f7b1e7e965.tar.gz
glusterfs-3c9d5578a623ed1da20e435ddb1283f7b1e7e965.tar.xz
glusterfs-3c9d5578a623ed1da20e435ddb1283f7b1e7e965.zip
posix: Implement a janitor thread to close fd
Problem: In the commit fb20713b380e1df8d7f9e9df96563be2f9144fd6 we use syntask to close fd but we have found the patch is reducing the performance Solution: Use janitor thread to close fd's and save the pfd ctx into ctx janitor list and also save the posix_xlator into pfd object to avoid the race condition during cleanup in brick_mux environment Change-Id: Ifb3d18a854b267333a3a9e39845bfefb83fbc092 Fixes: #1396 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/glusterfs/glusterfs.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libglusterfs/src/glusterfs/glusterfs.h b/libglusterfs/src/glusterfs/glusterfs.h
index e4dfda8d01..fc69ad0b74 100644
--- a/libglusterfs/src/glusterfs/glusterfs.h
+++ b/libglusterfs/src/glusterfs/glusterfs.h
@@ -730,6 +730,13 @@ struct _glusterfs_ctx {
} stats;
struct list_head volfile_list;
+ /* Add members to manage janitor threads for cleanup fd */
+ struct list_head janitor_fds;
+ pthread_cond_t fd_cond;
+ pthread_mutex_t fd_lock;
+ pthread_t janitor;
+ /* The variable is use to save total posix xlator count */
+ uint32_t pxl_count;
char volume_id[GF_UUID_BUF_SIZE]; /* Used only in protocol/client */
};