diff options
| author | Shreyas Siravara <sshreyas@fb.com> | 2016-07-16 08:22:43 -0700 |
|---|---|---|
| committer | Shreyas Siravara <sshreyas@fb.com> | 2016-12-14 18:10:30 -0800 |
| commit | 1ad70fb05cadf14aa5900ba642119e73a3f25c73 (patch) | |
| tree | f482ac9d24a3f5209a3131ce8c82b0d3622a2f9b /xlators | |
| parent | b43e301657e81d541174bade1f496caffc1c4aa5 (diff) | |
write-behind: Allow trickling-writes to be configurable, fix usage of page_size and window_size
Summary:
- It adds a configurable option for "trickling-writes".
- Makes `__wb_preprocess_winds()` use `wb_inode->window_conf` rather
than `page_size`, so that the window-size option is actually
respected.
- This is a port of D3576122 & D3738605 to 3.8.
Test Plan:
- Prove test which looks @ brick-level FOPs and ensures
that they fall in the right write-size bucket.
Reviewed By: rwareing
Signature: t1:3576122:1468892648:6923a6a19b18888577ce5173b5c9cb9531f941e7
Change-Id: I379a9f2f0c4768c9052b7e9dd71c5f0469cb2d68
Signed-off-by: Shreyas Siravara <sshreyas@fb.com>
Reviewed-on: http://review.gluster.org/16079
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Kevin Vigor <kvigor@fb.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators')
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-set.c | 12 | ||||
| -rw-r--r-- | xlators/performance/write-behind/src/write-behind.c | 14 |
2 files changed, 22 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c index ac484e246b1..e82339a537f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c @@ -1560,6 +1560,18 @@ struct volopt_map_entry glusterd_volopt_map[] = { .op_version = 2, .flags = OPT_FLAG_CLIENT_OPT }, + { .key = "performance.write-behind-trickling-writes", + .voltype = "performance/write-behind", + .option = "trickling-writes", + .op_version = 2, + .flags = OPT_FLAG_CLIENT_OPT + }, + { .key = "performance.nfs.write-behind-trickling-writes", + .voltype = "performance/write-behind", + .option = "trickling-writes", + .op_version = 2, + .flags = OPT_FLAG_CLIENT_OPT + }, { .key = "performance.lazy-open", .voltype = "performance/open-behind", .option = "lazy-open", diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c index 7f5719b1e48..bc59036ff88 100644 --- a/xlators/performance/write-behind/src/write-behind.c +++ b/xlators/performance/write-behind/src/write-behind.c @@ -169,6 +169,7 @@ typedef struct wb_request { typedef struct wb_conf { uint64_t aggregate_size; + uint64_t page_size; uint64_t window_size; gf_boolean_t flush_behind; gf_boolean_t trickling_writes; @@ -1207,18 +1208,21 @@ __wb_collapse_small_writes (wb_request_t *holder, wb_request_t *req) char *ptr = NULL; struct iobuf *iobuf = NULL; struct iobref *iobref = NULL; + struct wb_conf *conf = NULL; int ret = -1; ssize_t required_size = 0; size_t holder_len = 0; size_t req_len = 0; + conf = req->wb_inode->this->private; + if (!holder->iobref) { holder_len = iov_length (holder->stub->args.vector, holder->stub->args.count); req_len = iov_length (req->stub->args.vector, req->stub->args.count); - required_size = max ((THIS->ctx->page_size), + required_size = max ((conf->page_size), (holder_len + req_len)); iobuf = iobuf_get2 (req->wb_inode->this->ctx->iobuf_pool, required_size); @@ -1281,7 +1285,6 @@ __wb_preprocess_winds (wb_inode_t *wb_inode) wb_request_t *holder = NULL; wb_conf_t *conf = NULL; int ret = 0; - ssize_t page_size = 0; /* With asynchronous IO from a VM guest (as a file), there can be two sequential writes happening in two regions @@ -1292,7 +1295,6 @@ __wb_preprocess_winds (wb_inode_t *wb_inode) through the interleaved ops */ - page_size = wb_inode->this->ctx->page_size; conf = wb_inode->this->private; list_for_each_entry_safe (req, tmp, &wb_inode->todo, todo) { @@ -1343,7 +1345,7 @@ __wb_preprocess_winds (wb_inode_t *wb_inode) continue; } - space_left = page_size - holder->write_size; + space_left = wb_inode->window_conf - holder->write_size; if (space_left < req->write_size) { holder->ordering.go = 1; @@ -2471,6 +2473,9 @@ reconfigure (xlator_t *this, dict_t *options) GF_OPTION_RECONF ("cache-size", conf->window_size, options, size_uint64, out); + GF_OPTION_RECONF ("cache-size", conf->page_size, options, size_uint64, + out); + GF_OPTION_RECONF ("flush-behind", conf->flush_behind, options, bool, out); @@ -2522,6 +2527,7 @@ init (xlator_t *this) /* configure 'option window-size <size>' */ GF_OPTION_INIT ("cache-size", conf->window_size, size_uint64, out); + GF_OPTION_INIT ("cache-size", conf->page_size, size_uint64, out); if (!conf->window_size && conf->aggregate_size) { gf_msg (this->name, GF_LOG_WARNING, 0, |
