summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShreyas Siravara <sshreyas@fb.com>2017-12-06 07:41:19 -0800
committerJeff Darcy <jeff@pl.atyp.us>2017-12-08 20:40:03 +0000
commit742a4eed244833761697646044f20675d1411292 (patch)
treeca7f449b23c9d9a8336d0ed4f34b5beb0c265f94
parent5a29779aceec59069511cec7eff9b314e819eacc (diff)
nfs: Enable multi-core epoll support in gNFSd
Change-Id: Ie8a7b1ba04b0e83f5ec7a09f9d181fe59be479ca BUG: 1522847 Signed-off-by: Shreyas Siravara <sshreyas@fb.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-set.c6
-rw-r--r--xlators/nfs/server/src/nfs.c22
-rw-r--r--xlators/nfs/server/src/nfs.h5
3 files changed, 30 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
index eef95e8809d..5fdc032a135 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
@@ -2694,6 +2694,12 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.description = "When this option is set to off NFS falls back to "
"standard readdir instead of readdirp"
},
+ { .key = "nfs.event-threads",
+ .voltype = "nfs/server",
+ .option = "nfs.event-threads",
+ .type = NO_DOC,
+ .op_version = GD_OP_VERSION_4_0_0,
+ },
/* Cli options for Export authentication on nfs mount */
{ .key = "nfs.exports-auth-enable",
diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c
index b03f407e1bb..577c67833ce 100644
--- a/xlators/nfs/server/src/nfs.c
+++ b/xlators/nfs/server/src/nfs.c
@@ -1158,6 +1158,10 @@ nfs_init_state (xlator_t *this)
nfs->register_portmap = rpcsvc_register_portmap_enabled (nfs->rpcsvc);
+ GF_OPTION_INIT ("nfs.event-threads",
+ nfs->event_threads, uint32, free_foppool);
+ event_reconfigure_threads (this->ctx->event_pool, nfs->event_threads);
+
this->private = (void *)nfs;
INIT_LIST_HEAD (&nfs->versions);
nfs->generation = 1965;
@@ -1384,6 +1388,11 @@ nfs_reconfigure_state (xlator_t *this, dict_t *options)
nfs_reconfigure_acl3 (this);
}
+ GF_OPTION_RECONF ("nfs.event-threads",
+ nfs->event_threads, options, uint32, out);
+ event_reconfigure_threads (this->ctx->event_pool, nfs->event_threads);
+
+
ret = 0;
out:
return ret;
@@ -2122,6 +2131,17 @@ struct volume_options options[] = {
.description = "When this option is set to off NFS falls back to "
"standard readdir instead of readdirp"
},
-
+ { .key = {"nfs.event-threads"},
+ .type = GF_OPTION_TYPE_SIZET,
+ .min = 1,
+ .max = 32,
+ .default_value = "1",
+ .description = "Specifies the number of event threads to execute in"
+ "in parallel. Larger values would help process"
+ " responses faster, depending on available processing"
+ " power. Range 1-32 threads.",
+ .op_version = {GD_OP_VERSION_4_0_0},
+ .flags = OPT_FLAG_SETTABLE,
+ },
{ .key = {NULL} },
};
diff --git a/xlators/nfs/server/src/nfs.h b/xlators/nfs/server/src/nfs.h
index 9bcc88f5548..33ba419a573 100644
--- a/xlators/nfs/server/src/nfs.h
+++ b/xlators/nfs/server/src/nfs.h
@@ -93,13 +93,14 @@ struct nfs_state {
char *rmtab;
struct rpc_clnt *rpc_clnt;
gf_boolean_t server_aux_gids;
- uint32_t server_aux_gids_max_age;
- gid_cache_t gid_cache;
+ uint32_t server_aux_gids_max_age;
+ gid_cache_t gid_cache;
uint32_t generation;
gf_boolean_t register_portmap;
char *rpc_statd;
char *rpc_statd_pid_file;
gf_boolean_t rdirplus;
+ uint32_t event_threads;
};
struct nfs_inode_ctx {