aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaohua Li <shaohua.li@intel.com>2012-12-15 22:35:23 -0800
committerMoyster <oysterized@gmail.com>2016-09-13 13:13:22 +0200
commit4d4ba298b996753a9391c03c77f6dd91dc0ac6a5 (patch)
treebe75b3d8355b19721053c5e60388e71427cc4d7c
parentd26e9b920088e4ad42f0a3b491adc6af4138019d (diff)
downloadandroid_kernel_m2note-4d4ba298b996753a9391c03c77f6dd91dc0ac6a5.tar.gz
block: fiops sync/async scale
CFQ gives 2.5 times more share to sync workload. This matches CFQ. Note this is different with the read/write scale. We have 3 types of requests: 1. read 2. sync write 3. write CFQ doesn't differentitate type 1 and 2, but request cost of 1 and 2 are usually different for flash based storage. So we have both sync/async and read/write scale here. Change-Id: I3b36c94ba63df6d7a823c941a34a479da6243f20 Signed-off-by: Shaohua Li <shaohua.li@intel.com>
-rw-r--r--block/fiops-iosched.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/block/fiops-iosched.c b/block/fiops-iosched.c
index bff327c11..3c6c498f7 100644
--- a/block/fiops-iosched.c
+++ b/block/fiops-iosched.c
@@ -17,6 +17,8 @@
#define VIOS_READ_SCALE (1)
#define VIOS_WRITE_SCALE (1)
+#define VIOS_SYNC_SCALE (2)
+#define VIOS_ASYNC_SCALE (5)
struct fiops_rb_root {
struct rb_root rb;
@@ -39,6 +41,8 @@ struct fiops_data {
unsigned int read_scale;
unsigned int write_scale;
+ unsigned int sync_scale;
+ unsigned int async_scale;
};
struct fiops_ioc {
@@ -291,6 +295,9 @@ static u64 fiops_scaled_vios(struct fiops_data *fiopsd,
if (rq_data_dir(rq) == WRITE)
vios = vios * fiopsd->write_scale / fiopsd->read_scale;
+ if (!rq_is_sync(rq))
+ vios = vios * fiopsd->async_scale / fiopsd->sync_scale;
+
return vios;
}
@@ -513,6 +520,8 @@ static void *fiops_init_queue(struct request_queue *q)
fiopsd->read_scale = VIOS_READ_SCALE;
fiopsd->write_scale = VIOS_WRITE_SCALE;
+ fiopsd->sync_scale = VIOS_SYNC_SCALE;
+ fiopsd->async_scale = VIOS_ASYNC_SCALE;
return fiopsd;
}
@@ -557,6 +566,8 @@ static ssize_t __FUNC(struct elevator_queue *e, char *page) \
}
SHOW_FUNCTION(fiops_read_scale_show, fiopsd->read_scale);
SHOW_FUNCTION(fiops_write_scale_show, fiopsd->write_scale);
+SHOW_FUNCTION(fiops_sync_scale_show, fiopsd->sync_scale);
+SHOW_FUNCTION(fiops_async_scale_show, fiopsd->async_scale);
#undef SHOW_FUNCTION
#define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX) \
@@ -574,6 +585,8 @@ static ssize_t __FUNC(struct elevator_queue *e, const char *page, size_t count)
}
STORE_FUNCTION(fiops_read_scale_store, &fiopsd->read_scale, 1, 100);
STORE_FUNCTION(fiops_write_scale_store, &fiopsd->write_scale, 1, 100);
+STORE_FUNCTION(fiops_sync_scale_store, &fiopsd->sync_scale, 1, 100);
+STORE_FUNCTION(fiops_async_scale_store, &fiopsd->async_scale, 1, 100);
#undef STORE_FUNCTION
#define FIOPS_ATTR(name) \
@@ -582,6 +595,8 @@ STORE_FUNCTION(fiops_write_scale_store, &fiopsd->write_scale, 1, 100);
static struct elv_fs_entry fiops_attrs[] = {
FIOPS_ATTR(read_scale),
FIOPS_ATTR(write_scale),
+ FIOPS_ATTR(sync_scale),
+ FIOPS_ATTR(async_scale),
__ATTR_NULL
};