From 11be941ccc2857514cf7b65552c84c20e27b99e1 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Sun, 17 Feb 2013 16:36:50 -0800 Subject: 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 Reviewed-on: http://review.gluster.org/4526 Tested-by: Gluster Build System Reviewed-by: Raghavendra G --- xlators/performance/read-ahead/src/read-ahead.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'xlators/performance') 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} }, }; -- cgit