diff options
author | Xavier Hernandez <xhernandez@datalab.es> | 2014-07-14 17:34:04 +0200 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-09-15 23:12:16 -0700 |
commit | d97863562bb0d2f685df3d2e3aa4bef1299c8307 (patch) | |
tree | b8d9455cdface5425e2452e98751ac75dac358e4 /xlators/cluster/ec/src/ec-data.h | |
parent | 2be54585002cd1c9d02928b89a02047b58dd6aed (diff) |
ec: Optimize read/write performance
This patch significantly improves performance of read/write
operations on a dispersed volume by reusing previous inodelk/
entrylk operations on the same inode/entry. This reduces the
latency of each individual operation considerably.
Inode version and size are also updated when needed instead
of on each request. This gives an additional boost.
Change-Id: I4b98d5508c86b53032e16e295f72a3f83fd8fcac
BUG: 1122586
Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>
Reviewed-on: http://review.gluster.org/8369
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'xlators/cluster/ec/src/ec-data.h')
-rw-r--r-- | xlators/cluster/ec/src/ec-data.h | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/xlators/cluster/ec/src/ec-data.h b/xlators/cluster/ec/src/ec-data.h index e83b6ad74eb..cf9ce241adb 100644 --- a/xlators/cluster/ec/src/ec-data.h +++ b/xlators/cluster/ec/src/ec-data.h @@ -37,6 +37,9 @@ typedef union _ec_cbk ec_cbk_t; struct _ec_lock; typedef struct _ec_lock ec_lock_t; +struct _ec_lock_link; +typedef struct _ec_lock_link ec_lock_link_t; + struct _ec_fop_data; typedef struct _ec_fop_data ec_fop_data_t; @@ -60,8 +63,10 @@ struct _ec_fd struct _ec_inode { - uintptr_t bad; - ec_heal_t * heal; + uintptr_t bad; + struct list_head entry_locks; + struct list_head inode_locks; + ec_heal_t * heal; }; typedef int32_t (* fop_heal_cbk_t)(call_frame_t *, void * cookie, xlator_t *, @@ -124,8 +129,18 @@ union _ec_cbk struct _ec_lock { struct list_head list; + struct list_head waiting; uintptr_t mask; + uintptr_t good_mask; int32_t kind; + int32_t refs; + int32_t acquired; + int32_t have_size; + size_t size; + size_t size_delta; + uint64_t version; + uint64_t version_delta; + ec_fop_data_t * owner; loc_t loc; union { @@ -138,6 +153,13 @@ struct _ec_lock }; }; +struct _ec_lock_link +{ + ec_lock_t * lock; + ec_fop_data_t * fop; + struct list_head wait_list; +}; + struct _ec_fop_data { int32_t id; @@ -152,10 +174,13 @@ struct _ec_fop_data xlator_t * xl; call_frame_t * req_frame; // frame of the calling xlator call_frame_t * frame; // frame used by this fop - struct list_head lock_list; // list locks held by this fop struct list_head cbk_list; // sorted list of groups of answers struct list_head answer_list; // list of answers ec_cbk_data_t * answer; // accepted answer + int32_t lock_count; + int32_t locked; + ec_lock_link_t locks[2]; + int32_t have_size; size_t pre_size; size_t post_size; gf_lock_t lock; |