summaryrefslogtreecommitdiffstats
path: root/xlators/performance/read-ahead/src/read-ahead.c
diff options
context:
space:
mode:
authorAnand Avati <avati@redhat.com>2013-02-17 16:36:50 -0800
committerAnand Avati <avati@redhat.com>2013-02-20 10:11:09 -0800
commit11be941ccc2857514cf7b65552c84c20e27b99e1 (patch)
tree9c0a6d96ca2bc6a1fc914f831debfcf02324549b /xlators/performance/read-ahead/src/read-ahead.c
parente7fc8a2ca16b397ec69575aa22b179ef47410e46 (diff)
read-ahead: re-enable support for variable page size
Support for variable size page-size was disabled with the introduction of fixed size iobufs. Since the introduction of variable sized iobufs there is no reason to not have configurable page-size in read-ahead. This patch enables necessary changes in the translator for configurable page-size. Change-Id: I677d70fef50641eb041269aca92a088b9d4961cc BUG: 764204 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/4526 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <raghavendra@gluster.com>
Diffstat (limited to 'xlators/performance/read-ahead/src/read-ahead.c')
-rw-r--r--xlators/performance/read-ahead/src/read-ahead.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c
index 549496755..522fa52b8 100644
--- a/xlators/performance/read-ahead/src/read-ahead.c
+++ b/xlators/performance/read-ahead/src/read-ahead.c
@@ -498,7 +498,7 @@ ra_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
"expected offset (%"PRId64") when page_count=%d",
offset, file->page_count);
- if (file->expected < (conf->page_size * conf->page_count)) {
+ if (file->expected < (file->page_size * conf->page_count)) {
file->expected += size;
file->page_count = min ((file->expected
/ file->page_size),
@@ -1024,6 +1024,8 @@ reconfigure (xlator_t *this, dict_t *options)
GF_OPTION_RECONF ("page-count", conf->page_count, options, uint32, out);
+ GF_OPTION_RECONF ("page-size", conf->page_size, options, size, out);
+
ret = 0;
out:
return ret;
@@ -1056,6 +1058,8 @@ init (xlator_t *this)
conf->page_size = this->ctx->page_size;
+ GF_OPTION_INIT ("page-size", conf->page_size, size, out);
+
GF_OPTION_INIT ("page-count", conf->page_count, uint32, out);
GF_OPTION_INIT ("force-atime-update", conf->force_atime_update, bool, out);
@@ -1142,5 +1146,12 @@ struct volume_options options[] = {
.default_value = "4",
.description = "Number of pages that will be pre-fetched"
},
+ { .key = {"page-size"},
+ .type = GF_OPTION_TYPE_SIZET,
+ .min = 4096,
+ .max = 1048576 * 64,
+ .default_value = "131072",
+ .description = "Page size with which read-ahead performs server I/O"
+ },
{ .key = {NULL} },
};