|
|
21ab4e |
From 1ae13c3df0cf4406b5d66f5e3bd7c9442d5e75bb Mon Sep 17 00:00:00 2001
|
|
|
21ab4e |
From: Poornima G <pgurusid@redhat.com>
|
|
|
21ab4e |
Date: Tue, 17 Jan 2017 17:45:59 +0530
|
|
|
21ab4e |
Subject: [PATCH 359/361] glusterd, rda: If parallel readdir is enabled, split
|
|
|
21ab4e |
the cache limit
|
|
|
21ab4e |
|
|
|
21ab4e |
With patch http://review.gluster.org/#/c/16072/ readdir-ahead can be
|
|
|
21ab4e |
loaded as a child of dht. i.e. there can be more than one instance
|
|
|
21ab4e |
of readdir-ahead in client process. In this case the rda-cache-size
|
|
|
21ab4e |
should be split among all the readdir-ahead instances. Also the
|
|
|
21ab4e |
value of rda-request-size is considered as the minimum cache size
|
|
|
21ab4e |
of any readdir-ahead instance.
|
|
|
21ab4e |
|
|
|
21ab4e |
mainline:
|
|
|
21ab4e |
> BUG: 1401812
|
|
|
21ab4e |
> Reviewed-on: https://review.gluster.org/16424
|
|
|
21ab4e |
> Smoke: Gluster Build System <jenkins@build.gluster.org>
|
|
|
21ab4e |
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
|
|
21ab4e |
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
|
|
21ab4e |
> Reviewed-by: Kaushal M <kaushal@redhat.com>
|
|
|
21ab4e |
> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
|
|
|
21ab4e |
(cherry picked from commit f245dc568e3c22882e22ddd3e26a4207f5704e3b)
|
|
|
21ab4e |
|
|
|
21ab4e |
BUG: 1427096
|
|
|
21ab4e |
Change-Id: Iea2fe6d4c46adc09dd2e9a252332a0fe3005f2b9
|
|
|
21ab4e |
Signed-off-by: Poornima G <pgurusid@redhat.com>
|
|
|
21ab4e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/101419
|
|
|
21ab4e |
Tested-by: Milind Changire <mchangir@redhat.com>
|
|
|
21ab4e |
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
21ab4e |
---
|
|
|
21ab4e |
xlators/mgmt/glusterd/src/glusterd-volgen.c | 76 ++++++++++++++++++++++++-
|
|
|
21ab4e |
xlators/mgmt/glusterd/src/glusterd-volgen.h | 2 +
|
|
|
21ab4e |
xlators/mgmt/glusterd/src/glusterd-volume-set.c | 2 +
|
|
|
21ab4e |
3 files changed, 78 insertions(+), 2 deletions(-)
|
|
|
21ab4e |
|
|
|
21ab4e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
|
|
|
21ab4e |
index abebd10..d5ea166 100644
|
|
|
21ab4e |
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
|
|
|
21ab4e |
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
|
|
|
21ab4e |
@@ -3593,18 +3593,90 @@ out:
|
|
|
21ab4e |
return ret;
|
|
|
21ab4e |
}
|
|
|
21ab4e |
|
|
|
21ab4e |
+static int
|
|
|
21ab4e |
+client_graph_set_rda_options (volgen_graph_t *graph,
|
|
|
21ab4e |
+ glusterd_volinfo_t *volinfo,
|
|
|
21ab4e |
+ dict_t *set_dict)
|
|
|
21ab4e |
+{
|
|
|
21ab4e |
+ char *rda_cache_s = NULL;
|
|
|
21ab4e |
+ int32_t ret = 0;
|
|
|
21ab4e |
+ uint64_t rda_cache_size = 0;
|
|
|
21ab4e |
+ char *rda_req_s = NULL;
|
|
|
21ab4e |
+ uint64_t rda_req_size = 0;
|
|
|
21ab4e |
+ uint64_t new_cache_size = 0;
|
|
|
21ab4e |
+ char new_cache_size_str[50] = {0,};
|
|
|
21ab4e |
+ char new_req_size_str[50] = {0,};
|
|
|
21ab4e |
+ int dist_count = 0;
|
|
|
21ab4e |
+
|
|
|
21ab4e |
+ dist_count = volinfo->brick_count / volinfo->dist_leaf_count;
|
|
|
21ab4e |
+ if (dist_count <= 1)
|
|
|
21ab4e |
+ goto out;
|
|
|
21ab4e |
+
|
|
|
21ab4e |
+ if (graph->type == GF_REBALANCED ||
|
|
|
21ab4e |
+ graph->type == GF_QUOTAD ||
|
|
|
21ab4e |
+ graph->type == GF_SNAPD ||
|
|
|
21ab4e |
+ !glusterd_volinfo_get_boolean (volinfo, VKEY_PARALLEL_READDIR) ||
|
|
|
21ab4e |
+ !glusterd_volinfo_get_boolean (volinfo, VKEY_READDIR_AHEAD))
|
|
|
21ab4e |
+ goto out;
|
|
|
21ab4e |
+
|
|
|
21ab4e |
+ ret = glusterd_volinfo_get (volinfo, VKEY_RDA_CACHE_LIMIT, &rda_cache_s);
|
|
|
21ab4e |
+ if (ret < 0)
|
|
|
21ab4e |
+ goto out;
|
|
|
21ab4e |
+
|
|
|
21ab4e |
+ gf_string2bytesize_uint64 (rda_cache_s, &rda_cache_size);
|
|
|
21ab4e |
+
|
|
|
21ab4e |
+ ret = glusterd_volinfo_get (volinfo, VKEY_RDA_REQUEST_SIZE, &rda_req_s);
|
|
|
21ab4e |
+ if (ret < 0)
|
|
|
21ab4e |
+ goto out;
|
|
|
21ab4e |
+
|
|
|
21ab4e |
+ gf_string2bytesize_uint64 (rda_req_s, &rda_req_size);
|
|
|
21ab4e |
+
|
|
|
21ab4e |
+ new_cache_size = rda_cache_size / dist_count;
|
|
|
21ab4e |
+ if (new_cache_size < rda_req_size) {
|
|
|
21ab4e |
+ if (new_cache_size < 4 * 1024)
|
|
|
21ab4e |
+ new_cache_size = rda_req_size = 4 * 1024;
|
|
|
21ab4e |
+ else
|
|
|
21ab4e |
+ rda_req_size = new_cache_size;
|
|
|
21ab4e |
+
|
|
|
21ab4e |
+ snprintf (new_req_size_str, sizeof (new_req_size_str),
|
|
|
21ab4e |
+ "%ld%s", rda_req_size, "B");
|
|
|
21ab4e |
+ ret = dict_set_dynstr_with_alloc (set_dict,
|
|
|
21ab4e |
+ VKEY_RDA_REQUEST_SIZE,
|
|
|
21ab4e |
+ new_req_size_str);
|
|
|
21ab4e |
+ if (ret < 0)
|
|
|
21ab4e |
+ goto out;
|
|
|
21ab4e |
+ }
|
|
|
21ab4e |
+
|
|
|
21ab4e |
+ snprintf (new_cache_size_str, sizeof (new_cache_size_str),
|
|
|
21ab4e |
+ "%ld%s", new_cache_size, "B");
|
|
|
21ab4e |
+ ret = dict_set_dynstr_with_alloc (set_dict,
|
|
|
21ab4e |
+ VKEY_RDA_CACHE_LIMIT,
|
|
|
21ab4e |
+ new_cache_size_str);
|
|
|
21ab4e |
+ if (ret < 0)
|
|
|
21ab4e |
+ goto out;
|
|
|
21ab4e |
+
|
|
|
21ab4e |
+out:
|
|
|
21ab4e |
+ return ret;
|
|
|
21ab4e |
+}
|
|
|
21ab4e |
+
|
|
|
21ab4e |
+
|
|
|
21ab4e |
static int client_graph_set_perf_options(volgen_graph_t *graph,
|
|
|
21ab4e |
glusterd_volinfo_t *volinfo,
|
|
|
21ab4e |
dict_t *set_dict)
|
|
|
21ab4e |
{
|
|
|
21ab4e |
- data_t *tmp_data = NULL;
|
|
|
21ab4e |
- char *volname = NULL;
|
|
|
21ab4e |
+ data_t *tmp_data = NULL;
|
|
|
21ab4e |
+ char *volname = NULL;
|
|
|
21ab4e |
+ int ret = 0;
|
|
|
21ab4e |
|
|
|
21ab4e |
/*
|
|
|
21ab4e |
* Logic to make sure NFS doesn't have performance translators by
|
|
|
21ab4e |
* default for a volume
|
|
|
21ab4e |
*/
|
|
|
21ab4e |
volname = volinfo->volname;
|
|
|
21ab4e |
+ ret = client_graph_set_rda_options (graph, volinfo, set_dict);
|
|
|
21ab4e |
+ if (ret < 0)
|
|
|
21ab4e |
+ return ret;
|
|
|
21ab4e |
+
|
|
|
21ab4e |
tmp_data = dict_get (set_dict, "nfs-volume-file");
|
|
|
21ab4e |
if (!tmp_data)
|
|
|
21ab4e |
return volgen_graph_set_options_generic(graph, set_dict,
|
|
|
21ab4e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.h b/xlators/mgmt/glusterd/src/glusterd-volgen.h
|
|
|
21ab4e |
index bbf40b5..664b2ff 100644
|
|
|
21ab4e |
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.h
|
|
|
21ab4e |
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.h
|
|
|
21ab4e |
@@ -34,6 +34,8 @@
|
|
|
21ab4e |
#define VKEY_FEATURES_SCRUB "features.scrub"
|
|
|
21ab4e |
#define VKEY_PARALLEL_READDIR "performance.parallel-readdir"
|
|
|
21ab4e |
#define VKEY_READDIR_AHEAD "performance.readdir-ahead"
|
|
|
21ab4e |
+#define VKEY_RDA_CACHE_LIMIT "performance.rda-cache-limit"
|
|
|
21ab4e |
+#define VKEY_RDA_REQUEST_SIZE "performance.rda-request-size"
|
|
|
21ab4e |
|
|
|
21ab4e |
#define AUTH_ALLOW_MAP_KEY "auth.allow"
|
|
|
21ab4e |
#define AUTH_REJECT_MAP_KEY "auth.reject"
|
|
|
21ab4e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
|
|
|
21ab4e |
index a2ef7c9..78b2ead 100644
|
|
|
21ab4e |
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
|
|
|
21ab4e |
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
|
|
|
21ab4e |
@@ -3032,6 +3032,7 @@ struct volopt_map_entry glusterd_volopt_map[] = {
|
|
|
21ab4e |
{ .key = "performance.rda-request-size",
|
|
|
21ab4e |
.voltype = "performance/readdir-ahead",
|
|
|
21ab4e |
.option = "rda-request-size",
|
|
|
21ab4e |
+ .value = "128KB",
|
|
|
21ab4e |
.flags = OPT_FLAG_CLIENT_OPT,
|
|
|
21ab4e |
.type = DOC,
|
|
|
21ab4e |
.op_version = GD_OP_VERSION_3_9_1,
|
|
|
21ab4e |
@@ -3051,6 +3052,7 @@ struct volopt_map_entry glusterd_volopt_map[] = {
|
|
|
21ab4e |
},
|
|
|
21ab4e |
{ .key = "performance.rda-cache-limit",
|
|
|
21ab4e |
.voltype = "performance/readdir-ahead",
|
|
|
21ab4e |
+ .value = "10MB",
|
|
|
21ab4e |
.type = DOC,
|
|
|
21ab4e |
.flags = OPT_FLAG_CLIENT_OPT,
|
|
|
21ab4e |
.op_version = GD_OP_VERSION_3_9_1,
|
|
|
21ab4e |
--
|
|
|
21ab4e |
1.8.3.1
|
|
|
21ab4e |
|