summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/mem-types.h
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2017-04-17 15:50:07 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2017-05-12 13:32:32 +0000
commit45a5cea1ad028bdff5f33770df8ecdd9ac69b6f1 (patch)
treebf2b01236a5e32354857753a10a2e4e9ef9b7c19 /libglusterfs/src/mem-types.h
parentd7be198f7d5d3332880e77aec1b6a645f2abd02b (diff)
core: make the per glusterfs_ctx_t timer-wheel refcounted
xlators can use a 'global' timer-wheel for scheduling events. This timer-wheel is managed per glusterfs_ctx_t, but does not need to be allocated for every graph. When an xlator wants to use the timer-wheel, it will be instanciated on demand, and provided to xlators that request it later on. By adding a reference counter to the glusterfs_ctx_t for the timer-wheel, the threads and structures can be cleaned up when the last xlator does not have a need for it anymore. In general, the xlators request the timer-wheel in init(), and they should return it in fini(). Because the timer-wheel is managed per glusterfs_ctx_t, the functions can be added to ctx.c and do not need to live in their very minimal tw.[ch] files. >Reported-by: Poornima G <pgurusid@redhat.com> >Signed-off-by: Niels de Vos <ndevos@redhat.com> >Reviewed-on: https://review.gluster.org/17068 >NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> >CentOS-regression: Gluster Build System <jenkins@build.gluster.org> >Smoke: Gluster Build System <jenkins@build.gluster.org> >Reviewed-by: Amar Tumballi <amarts@redhat.com> >Reviewed-by: Zhou Zhengping <johnzzpcrystal@gmail.com> >Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> >(cherry picked from commit 73fcf3a874b2049da31d01b8363d1ac85c9488c2) Change-Id: I19d225b39aaa272d9005ba7adc3104c3764f1572 BUG: 1450267 Reviewed-on: https://review.gluster.org/17262 Tested-by: Poornima G <pgurusid@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'libglusterfs/src/mem-types.h')
-rw-r--r--libglusterfs/src/mem-types.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libglusterfs/src/mem-types.h b/libglusterfs/src/mem-types.h
index b41805e1f02..d5b2fcd64bd 100644
--- a/libglusterfs/src/mem-types.h
+++ b/libglusterfs/src/mem-types.h
@@ -164,6 +164,7 @@ enum gf_common_mem_types_ {
/*used for compound fops*/
gf_mt_compound_req_t,
gf_mt_compound_rsp_t,
+ gf_common_mt_tw_ctx,
gf_common_mt_tw_timer_list,
/*lock migration*/
gf_common_mt_lock_mig,