From 004f64e93d23f44144483d21422f47e81d358045 Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Fri, 24 Apr 2015 10:10:35 +0530 Subject: core: Global timer-wheel Instantiate a process wide global instance of the timer wheel data structure. Spawning glusterfs* process with option arg "--global-timer-wheel" instantiates a global instance of timer-wheel under global context (->ctx). Translators can make use of this process wide instance [via a call to glusterfs_global_timer_wheel()] instead of maintaining an instance of their own and possibly consuming more memory. Linux kernel too has a single instance of timer wheel where subsystems such as IO, networking, etc.. make use of. Bitrot daemon would be early consumers of this: bitrot translator instances for multiple volumes would track objects belonging to their respective bricks in this global expiry tracking data structure. This is also a first step to move GlusterFS timer mechanism to use timer-wheel. Change-Id: Ie882df607e07acaced846ea269ebf1ece306d6ae BUG: 1170075 Signed-off-by: Venky Shankar Reviewed-on: http://review.gluster.org/10380 Tested-by: NetBSD Build System Reviewed-by: Vijay Bellur Tested-by: Gluster Build System --- libglusterfs/src/glusterfs.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libglusterfs/src/glusterfs.h') diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h index 50a5dba86ee..e9b54535e66 100644 --- a/libglusterfs/src/glusterfs.h +++ b/libglusterfs/src/glusterfs.h @@ -434,6 +434,10 @@ struct _cmd_args { int gid_timeout; char gid_timeout_set; int aux_gfid_mount; + + /* need a process wide timer-wheel? */ + int global_timer_wheel; + struct list_head xlator_options; /* list of xlator_option_t */ /* fuse options */ @@ -496,6 +500,8 @@ typedef enum { MGMT_SSL_ALWAYS } mgmt_ssl_t; +struct tvec_base; + struct _glusterfs_ctx { cmd_args_t cmd_args; char *process_uuid; @@ -570,6 +576,8 @@ struct _glusterfs_ctx { pthread_cond_t notify_cond; int notifying; + struct tvec_base *timer_wheel; /* global timer-wheel instance */ + }; typedef struct _glusterfs_ctx glusterfs_ctx_t; -- cgit