diff options
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r-- | block/cfq-iosched.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index d3d76136f53a..1d9c3c70a9a0 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -456,6 +456,9 @@ static void cfq_add_rq_rb(struct request *rq) | |||
456 | */ | 456 | */ |
457 | while ((__alias = elv_rb_add(&cfqq->sort_list, rq)) != NULL) | 457 | while ((__alias = elv_rb_add(&cfqq->sort_list, rq)) != NULL) |
458 | cfq_dispatch_insert(cfqd->queue, __alias); | 458 | cfq_dispatch_insert(cfqd->queue, __alias); |
459 | |||
460 | if (!cfq_cfqq_on_rr(cfqq)) | ||
461 | cfq_add_cfqq_rr(cfqd, cfqq); | ||
459 | } | 462 | } |
460 | 463 | ||
461 | static inline void | 464 | static inline void |
@@ -1215,11 +1218,12 @@ static inline void changed_ioprio(struct cfq_io_context *cic) | |||
1215 | { | 1218 | { |
1216 | struct cfq_data *cfqd = cic->key; | 1219 | struct cfq_data *cfqd = cic->key; |
1217 | struct cfq_queue *cfqq; | 1220 | struct cfq_queue *cfqq; |
1221 | unsigned long flags; | ||
1218 | 1222 | ||
1219 | if (unlikely(!cfqd)) | 1223 | if (unlikely(!cfqd)) |
1220 | return; | 1224 | return; |
1221 | 1225 | ||
1222 | spin_lock(cfqd->queue->queue_lock); | 1226 | spin_lock_irqsave(cfqd->queue->queue_lock, flags); |
1223 | 1227 | ||
1224 | cfqq = cic->cfqq[ASYNC]; | 1228 | cfqq = cic->cfqq[ASYNC]; |
1225 | if (cfqq) { | 1229 | if (cfqq) { |
@@ -1236,7 +1240,7 @@ static inline void changed_ioprio(struct cfq_io_context *cic) | |||
1236 | if (cfqq) | 1240 | if (cfqq) |
1237 | cfq_mark_cfqq_prio_changed(cfqq); | 1241 | cfq_mark_cfqq_prio_changed(cfqq); |
1238 | 1242 | ||
1239 | spin_unlock(cfqd->queue->queue_lock); | 1243 | spin_unlock_irqrestore(cfqd->queue->queue_lock, flags); |
1240 | } | 1244 | } |
1241 | 1245 | ||
1242 | static void cfq_ioc_set_ioprio(struct io_context *ioc) | 1246 | static void cfq_ioc_set_ioprio(struct io_context *ioc) |
@@ -1362,6 +1366,7 @@ cfq_cic_link(struct cfq_data *cfqd, struct io_context *ioc, | |||
1362 | struct rb_node **p; | 1366 | struct rb_node **p; |
1363 | struct rb_node *parent; | 1367 | struct rb_node *parent; |
1364 | struct cfq_io_context *__cic; | 1368 | struct cfq_io_context *__cic; |
1369 | unsigned long flags; | ||
1365 | void *k; | 1370 | void *k; |
1366 | 1371 | ||
1367 | cic->ioc = ioc; | 1372 | cic->ioc = ioc; |
@@ -1391,9 +1396,9 @@ restart: | |||
1391 | rb_link_node(&cic->rb_node, parent, p); | 1396 | rb_link_node(&cic->rb_node, parent, p); |
1392 | rb_insert_color(&cic->rb_node, &ioc->cic_root); | 1397 | rb_insert_color(&cic->rb_node, &ioc->cic_root); |
1393 | 1398 | ||
1394 | spin_lock_irq(cfqd->queue->queue_lock); | 1399 | spin_lock_irqsave(cfqd->queue->queue_lock, flags); |
1395 | list_add(&cic->queue_list, &cfqd->cic_list); | 1400 | list_add(&cic->queue_list, &cfqd->cic_list); |
1396 | spin_unlock_irq(cfqd->queue->queue_lock); | 1401 | spin_unlock_irqrestore(cfqd->queue->queue_lock, flags); |
1397 | } | 1402 | } |
1398 | 1403 | ||
1399 | /* | 1404 | /* |
@@ -1650,9 +1655,6 @@ static void cfq_insert_request(request_queue_t *q, struct request *rq) | |||
1650 | 1655 | ||
1651 | cfq_add_rq_rb(rq); | 1656 | cfq_add_rq_rb(rq); |
1652 | 1657 | ||
1653 | if (!cfq_cfqq_on_rr(cfqq)) | ||
1654 | cfq_add_cfqq_rr(cfqd, cfqq); | ||
1655 | |||
1656 | list_add_tail(&rq->queuelist, &cfqq->fifo); | 1658 | list_add_tail(&rq->queuelist, &cfqq->fifo); |
1657 | 1659 | ||
1658 | cfq_rq_enqueued(cfqd, cfqq, rq); | 1660 | cfq_rq_enqueued(cfqd, cfqq, rq); |