summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2017-09-07 18:48:34 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2017-10-02 12:41:57 +0000
commit2a663389c5faf31f267be7f7fa98589019463c71 (patch)
tree26dcff2d384dca8b87f0c35227079d40675fe964 /xlators
parentf5998f07dfd21d06a4119416ca79db50232b50d4 (diff)
mount/fuse: Make event-history feature configurable
... and disable it by default. Backport of: > Change-Id: Ia533788d309c78688a315dc8cd04d30fad9e9485 > Reviewed-on: https://review.gluster.org/18242 > BUG: 1467614 > cherry-picked from commit 956d43d6e89d40ee683547003b876f1f456f03b6 This is because having it disabled seems to improve performance. This could be due to the lock contention by the different epoll threads on the circular buff lock in the fop cbks just before writing their response to /dev/fuse. Just to provide some data - wrt ovirt-gluster hyperconverged environment, I saw an increase in IOPs by 12K with event-history disabled for randrom read workload. Usage: mount -t glusterfs -o event-history=on $HOSTNAME:$VOLNAME $MOUNTPOINT OR glusterfs --event-history=on --volfile-server=$HOSTNAME --volfile-id=$VOLNAME $MOUNTPOINT Change-Id: Ia533788d309c78688a315dc8cd04d30fad9e9485 BUG: 1495430 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c34
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.h14
-rwxr-xr-xxlators/mount/fuse/utils/mount.glusterfs.in7
3 files changed, 41 insertions, 14 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 2a23a85bd68..0f672286c06 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -5153,10 +5153,15 @@ fuse_priv_dump (xlator_t *this)
int
fuse_history_dump (xlator_t *this)
{
- int ret = -1;
- char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0,};
+ int ret = -1;
+ char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0,};
+ fuse_private_t *priv = this->private;
GF_VALIDATE_OR_GOTO ("fuse", this, out);
+
+ if (!priv->event_history)
+ goto out;
+
GF_VALIDATE_OR_GOTO (this->name, this->history, out);
gf_proc_dump_build_key (key_prefix, "xlator.mount.fuse",
@@ -5644,6 +5649,9 @@ init (xlator_t *this_xl)
}
}
+ GF_OPTION_INIT("event-history", priv->event_history, bool,
+ cleanup_exit);
+
/* user has set only background-qlen, not congestion-threshold,
use the fuse kernel driver formula to set congestion. ie, 75% */
if (dict_get (this_xl->options, "background-qlen") &&
@@ -5714,14 +5722,16 @@ init (xlator_t *this_xl)
if (priv->fd == -1)
goto cleanup_exit;
- event = eh_new (FUSE_EVENT_HISTORY_SIZE, _gf_false, NULL);
- if (!event) {
- gf_log (this_xl->name, GF_LOG_ERROR,
- "could not create a new event history");
- goto cleanup_exit;
- }
+ if (priv->event_history) {
+ event = eh_new (FUSE_EVENT_HISTORY_SIZE, _gf_false, NULL);
+ if (!event) {
+ gf_log (this_xl->name, GF_LOG_ERROR,
+ "could not create a new event history");
+ goto cleanup_exit;
+ }
- this_xl->history = event;
+ this_xl->history = event;
+ }
pthread_mutex_init (&priv->fuse_dump_mutex, NULL);
pthread_cond_init (&priv->sync_cond, NULL);
@@ -5913,5 +5923,11 @@ struct volume_options options[] = {
.type = GF_OPTION_TYPE_BOOL,
.default_value = "false"
},
+ { .key = {"event-history"},
+ .type = GF_OPTION_TYPE_BOOL,
+ .default_value = "false",
+ .description = "This option can be used to enable or disable fuse "
+ "event history.",
+ },
{ .key = {NULL} },
};
diff --git a/xlators/mount/fuse/src/fuse-bridge.h b/xlators/mount/fuse/src/fuse-bridge.h
index e4075c83f2c..85e9ebc795d 100644
--- a/xlators/mount/fuse/src/fuse-bridge.h
+++ b/xlators/mount/fuse/src/fuse-bridge.h
@@ -134,6 +134,8 @@ struct fuse_private {
/* Enable or disable capability support */
gf_boolean_t capability;
+ /* Enable or disable event history */
+ gf_boolean_t event_history;
};
typedef struct fuse_private fuse_private_t;
@@ -277,7 +279,8 @@ typedef struct fuse_graph_switch_args fuse_graph_switch_args_t;
#define fuse_log_eh_fop(this, state, frame, op_ret, op_errno) \
do { \
- if (this->history) { \
+ fuse_private_t *priv = this->private; \
+ if (this->history && priv->event_history) { \
if (state->fd) \
gf_log_eh ("op_ret: %d, op_errno: %d, " \
"%"PRIu64", %s () => %p, gfid: %s", \
@@ -297,10 +300,11 @@ typedef struct fuse_graph_switch_args fuse_graph_switch_args_t;
} \
} while(0)
-#define fuse_log_eh(this, args...) \
- do { \
- if (this->history) \
- gf_log_eh(args); \
+#define fuse_log_eh(this, args...) \
+ do { \
+ fuse_private_t *priv = this->private; \
+ if (this->history && priv->event_history) \
+ gf_log_eh(args); \
} while (0)
static inline xlator_t *
diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in
index 6c4cdfed062..3c68eee0c70 100755
--- a/xlators/mount/fuse/utils/mount.glusterfs.in
+++ b/xlators/mount/fuse/utils/mount.glusterfs.in
@@ -202,6 +202,10 @@ start_glusterfs ()
cmd_line=$(echo "$cmd_line --use-readdirp=$use_readdirp");
fi
+ if [ -n "$event_history" ]; then
+ cmd_line=$(echo "$cmd_line --event-history=$event_history");
+ fi
+
if [ -n "$volume_name" ]; then
cmd_line=$(echo "$cmd_line --volume-name=$volume_name");
fi
@@ -460,6 +464,9 @@ with_options()
"use-readdirp")
use_readdirp=$value
;;
+ "event-history")
+ event_history=$value
+ ;;
"no-root-squash")
if [ $value = "yes" ] ||
[ $value = "on" ] ||