summaryrefslogtreecommitdiffstats
path: root/xlators/mount/fuse/src/fuse-bridge.c
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2017-09-07 18:48:34 +0530
committerjiffin tony Thottan <jthottan@redhat.com>2017-10-05 12:02:42 +0000
commit761942e9fe8f6d7bbd5c56720e52dc4f6663cd9f (patch)
treed942e7b89b5e4bbf07e30a61cf9639dcb78f2c0b /xlators/mount/fuse/src/fuse-bridge.c
parent33d030d12ff46f900b3d75375fa36983036ec160 (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: 1495397 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Diffstat (limited to 'xlators/mount/fuse/src/fuse-bridge.c')
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 4865ffdc562..d7c213425c6 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -5162,10 +5162,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",
@@ -5660,6 +5665,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") &&
@@ -5758,14 +5766,16 @@ init (xlator_t *this_xl)
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);
@@ -5962,5 +5972,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} },
};