aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-08-23 08:50:29 -0400
committerJens Axboe <jaxboe@fusionio.com>2011-08-23 08:50:29 -0400
commit65299a3b788bd274bed92f9fa3232082c9f3ea70 (patch)
tree191c0afe31c15ac4c1bab96e0a07fddb097d0de8 /block
parent5dc06c5a70b79a323152bec7e55783e705767e63 (diff)
block: separate priority boosting from REQ_META
Add a new REQ_PRIO to let requests preempt others in the cfq I/O schedule, and lave REQ_META purely for marking requests as metadata in blktrace. All existing callers of REQ_META except for XFS are updated to also set REQ_PRIO for now. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block')
-rw-r--r--block/cfq-iosched.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index a33bd4377c61..16ace89613bc 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -130,8 +130,8 @@ struct cfq_queue {
130 unsigned long slice_end; 130 unsigned long slice_end;
131 long slice_resid; 131 long slice_resid;
132 132
133 /* pending metadata requests */ 133 /* pending priority requests */
134 int meta_pending; 134 int prio_pending;
135 /* number of requests that are on the dispatch list or inside driver */ 135 /* number of requests that are on the dispatch list or inside driver */
136 int dispatched; 136 int dispatched;
137 137
@@ -684,8 +684,8 @@ cfq_choose_req(struct cfq_data *cfqd, struct request *rq1, struct request *rq2,
684 if (rq_is_sync(rq1) != rq_is_sync(rq2)) 684 if (rq_is_sync(rq1) != rq_is_sync(rq2))
685 return rq_is_sync(rq1) ? rq1 : rq2; 685 return rq_is_sync(rq1) ? rq1 : rq2;
686 686
687 if ((rq1->cmd_flags ^ rq2->cmd_flags) & REQ_META) 687 if ((rq1->cmd_flags ^ rq2->cmd_flags) & REQ_PRIO)
688 return rq1->cmd_flags & REQ_META ? rq1 : rq2; 688 return rq1->cmd_flags & REQ_PRIO ? rq1 : rq2;
689 689
690 s1 = blk_rq_pos(rq1); 690 s1 = blk_rq_pos(rq1);
691 s2 = blk_rq_pos(rq2); 691 s2 = blk_rq_pos(rq2);
@@ -1612,9 +1612,9 @@ static void cfq_remove_request(struct request *rq)
1612 cfqq->cfqd->rq_queued--; 1612 cfqq->cfqd->rq_queued--;
1613 cfq_blkiocg_update_io_remove_stats(&(RQ_CFQG(rq))->blkg, 1613 cfq_blkiocg_update_io_remove_stats(&(RQ_CFQG(rq))->blkg,
1614 rq_data_dir(rq), rq_is_sync(rq)); 1614 rq_data_dir(rq), rq_is_sync(rq));
1615 if (rq->cmd_flags & REQ_META) { 1615 if (rq->cmd_flags & REQ_PRIO) {
1616 WARN_ON(!cfqq->meta_pending); 1616 WARN_ON(!cfqq->prio_pending);
1617 cfqq->meta_pending--; 1617 cfqq->prio_pending--;
1618 } 1618 }
1619} 1619}
1620 1620
@@ -3372,7 +3372,7 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq,
3372 * So both queues are sync. Let the new request get disk time if 3372 * So both queues are sync. Let the new request get disk time if
3373 * it's a metadata request and the current queue is doing regular IO. 3373 * it's a metadata request and the current queue is doing regular IO.
3374 */ 3374 */
3375 if ((rq->cmd_flags & REQ_META) && !cfqq->meta_pending) 3375 if ((rq->cmd_flags & REQ_PRIO) && !cfqq->prio_pending)
3376 return true; 3376 return true;
3377 3377
3378 /* 3378 /*
@@ -3439,8 +3439,8 @@ cfq_rq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
3439 struct cfq_io_context *cic = RQ_CIC(rq); 3439 struct cfq_io_context *cic = RQ_CIC(rq);
3440 3440
3441 cfqd->rq_queued++; 3441 cfqd->rq_queued++;
3442 if (rq->cmd_flags & REQ_META) 3442 if (rq->cmd_flags & REQ_PRIO)
3443 cfqq->meta_pending++; 3443 cfqq->prio_pending++;
3444 3444
3445 cfq_update_io_thinktime(cfqd, cfqq, cic); 3445 cfq_update_io_thinktime(cfqd, cfqq, cic);
3446 cfq_update_io_seektime(cfqd, cfqq, rq); 3446 cfq_update_io_seektime(cfqd, cfqq, rq);