lkml.org 
[lkml]   [2012]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch v2 6/8]block: fiops bias sync workload
If there are async requests running, delay async workload. Otherwise
async workload (usually very deep iodepth) will use all queue iodepth
and later sync requests will get long delayed. The idea is from CFQ.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
---
block/fiops-iosched.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

Index: linux/block/fiops-iosched.c
===================================================================
--- linux.orig/block/fiops-iosched.c 2012-01-19 11:21:01.000000000 +0800
+++ linux/block/fiops-iosched.c 2012-01-21 10:30:46.000000000 +0800
@@ -372,6 +372,7 @@ static struct fiops_ioc *fiops_select_io
struct fiops_ioc *ioc;
struct fiops_rb_root *service_tree = NULL;
int i;
+ struct request *rq;

for (i = RT_WORKLOAD; i >= IDLE_WORKLOAD; i--) {
if (!RB_EMPTY_ROOT(&fiopsd->service_tree[i].rb)) {
@@ -384,6 +385,17 @@ static struct fiops_ioc *fiops_select_io
return NULL;

ioc = fiops_rb_first(service_tree);
+
+ rq = rq_entry_fifo(ioc->fifo.next);
+ /*
+ * we are the only async task and sync requests are in flight, delay a
+ * moment. If there are other tasks coming, sync tasks have no chance
+ * to be starved, don't delay
+ */
+ if (!rq_is_sync(rq) && fiopsd->in_flight[1] != 0 &&
+ service_tree->count == 1)
+ return NULL;
+
return ioc;
}



\
 
 \ /
  Last update: 2012-01-30 08:11    [W:0.063 / U:4.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site