aboutsummaryrefslogtreecommitdiffstats
path: root/block/cfq-iosched.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r--block/cfq-iosched.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 6a062eebbd15..e8525fa72823 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1136,12 +1136,8 @@ static int cfq_dispatch_requests(struct request_queue *q, int force)
1136 if (cfq_class_idle(cfqq)) 1136 if (cfq_class_idle(cfqq))
1137 max_dispatch = 1; 1137 max_dispatch = 1;
1138 1138
1139 if (cfqq->dispatched >= max_dispatch) { 1139 if (cfqq->dispatched >= max_dispatch && cfqd->busy_queues > 1)
1140 if (cfqd->busy_queues > 1) 1140 break;
1141 break;
1142 if (cfqq->dispatched >= 4 * max_dispatch)
1143 break;
1144 }
1145 1141
1146 if (cfqd->sync_flight && !cfq_cfqq_sync(cfqq)) 1142 if (cfqd->sync_flight && !cfq_cfqq_sync(cfqq))
1147 break; 1143 break;
@@ -1318,7 +1314,15 @@ static void cfq_exit_single_io_context(struct io_context *ioc,
1318 unsigned long flags; 1314 unsigned long flags;
1319 1315
1320 spin_lock_irqsave(q->queue_lock, flags); 1316 spin_lock_irqsave(q->queue_lock, flags);
1321 __cfq_exit_single_io_context(cfqd, cic); 1317
1318 /*
1319 * Ensure we get a fresh copy of the ->key to prevent
1320 * race between exiting task and queue
1321 */
1322 smp_read_barrier_depends();
1323 if (cic->key)
1324 __cfq_exit_single_io_context(cfqd, cic);
1325
1322 spin_unlock_irqrestore(q->queue_lock, flags); 1326 spin_unlock_irqrestore(q->queue_lock, flags);
1323 } 1327 }
1324} 1328}
@@ -2160,7 +2164,7 @@ out_cont:
2160static void cfq_shutdown_timer_wq(struct cfq_data *cfqd) 2164static void cfq_shutdown_timer_wq(struct cfq_data *cfqd)
2161{ 2165{
2162 del_timer_sync(&cfqd->idle_slice_timer); 2166 del_timer_sync(&cfqd->idle_slice_timer);
2163 kblockd_flush_work(&cfqd->unplug_work); 2167 cancel_work_sync(&cfqd->unplug_work);
2164} 2168}
2165 2169
2166static void cfq_put_async_queues(struct cfq_data *cfqd) 2170static void cfq_put_async_queues(struct cfq_data *cfqd)
@@ -2178,7 +2182,7 @@ static void cfq_put_async_queues(struct cfq_data *cfqd)
2178 cfq_put_queue(cfqd->async_idle_cfqq); 2182 cfq_put_queue(cfqd->async_idle_cfqq);
2179} 2183}
2180 2184
2181static void cfq_exit_queue(elevator_t *e) 2185static void cfq_exit_queue(struct elevator_queue *e)
2182{ 2186{
2183 struct cfq_data *cfqd = e->elevator_data; 2187 struct cfq_data *cfqd = e->elevator_data;
2184 struct request_queue *q = cfqd->queue; 2188 struct request_queue *q = cfqd->queue;
@@ -2288,7 +2292,7 @@ cfq_var_store(unsigned int *var, const char *page, size_t count)
2288} 2292}
2289 2293
2290#define SHOW_FUNCTION(__FUNC, __VAR, __CONV) \ 2294#define SHOW_FUNCTION(__FUNC, __VAR, __CONV) \
2291static ssize_t __FUNC(elevator_t *e, char *page) \ 2295static ssize_t __FUNC(struct elevator_queue *e, char *page) \
2292{ \ 2296{ \
2293 struct cfq_data *cfqd = e->elevator_data; \ 2297 struct cfq_data *cfqd = e->elevator_data; \
2294 unsigned int __data = __VAR; \ 2298 unsigned int __data = __VAR; \
@@ -2308,7 +2312,7 @@ SHOW_FUNCTION(cfq_slice_async_rq_show, cfqd->cfq_slice_async_rq, 0);
2308#undef SHOW_FUNCTION 2312#undef SHOW_FUNCTION
2309 2313
2310#define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX, __CONV) \ 2314#define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX, __CONV) \
2311static ssize_t __FUNC(elevator_t *e, const char *page, size_t count) \ 2315static ssize_t __FUNC(struct elevator_queue *e, const char *page, size_t count) \
2312{ \ 2316{ \
2313 struct cfq_data *cfqd = e->elevator_data; \ 2317 struct cfq_data *cfqd = e->elevator_data; \
2314 unsigned int __data; \ 2318 unsigned int __data; \