diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-08-23 14:50:29 +0200 |
---|---|---|
committer | Brett Rogers <brettrogers11@gmail.com> | 2016-02-16 16:29:47 -0800 |
commit | 04f87da71ab532ee1d794cbb2a464d2f35cd118d (patch) | |
tree | 1cf7ef6f9d9cf3f1b226ee1cbb0040308f90916a /block | |
parent | b1ce5b792e0c6bddb9012dbbff63cfcc3a4aaf87 (diff) | |
download | kernel_samsung_smdk4412-04f87da71ab532ee1d794cbb2a464d2f35cd118d.tar.gz kernel_samsung_smdk4412-04f87da71ab532ee1d794cbb2a464d2f35cd118d.tar.bz2 kernel_samsung_smdk4412-04f87da71ab532ee1d794cbb2a464d2f35cd118d.zip |
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.
Backported to 3.0.x by Ketut Putu Kumajaya <ketut.kumajaya@gmail.com>
Change-Id: Iad5ba7a105438776f74788c0aedaf85210c613f9
Diffstat (limited to 'block')
-rw-r--r-- | block/cfq-iosched.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index bfe3bbe00973..fb5fe2d2f814 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -129,8 +129,8 @@ struct cfq_queue { unsigned long slice_end; long slice_resid; - /* pending metadata requests */ - int meta_pending; + /* pending priority requests */ + int prio_pending; /* number of requests that are on the dispatch list or inside driver */ int dispatched; @@ -670,8 +670,8 @@ cfq_choose_req(struct cfq_data *cfqd, struct request *rq1, struct request *rq2, if (rq_is_sync(rq1) != rq_is_sync(rq2)) return rq_is_sync(rq1) ? rq1 : rq2; - if ((rq1->cmd_flags ^ rq2->cmd_flags) & REQ_META) - return rq1->cmd_flags & REQ_META ? rq1 : rq2; + if ((rq1->cmd_flags ^ rq2->cmd_flags) & REQ_PRIO) + return rq1->cmd_flags & REQ_PRIO ? rq1 : rq2; s1 = blk_rq_pos(rq1); s2 = blk_rq_pos(rq2); @@ -1598,9 +1598,9 @@ static void cfq_remove_request(struct request *rq) cfqq->cfqd->rq_queued--; cfq_blkiocg_update_io_remove_stats(&(RQ_CFQG(rq))->blkg, rq_data_dir(rq), rq_is_sync(rq)); - if (rq->cmd_flags & REQ_META) { - WARN_ON(!cfqq->meta_pending); - cfqq->meta_pending--; + if (rq->cmd_flags & REQ_PRIO) { + WARN_ON(!cfqq->prio_pending); + cfqq->prio_pending--; } } @@ -3351,7 +3351,7 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq, * So both queues are sync. Let the new request get disk time if * it's a metadata request and the current queue is doing regular IO. */ - if ((rq->cmd_flags & REQ_META) && !cfqq->meta_pending) + if ((rq->cmd_flags & REQ_PRIO) && !cfqq->prio_pending) return true; /* @@ -3418,8 +3418,8 @@ cfq_rq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq, struct cfq_io_context *cic = RQ_CIC(rq); cfqd->rq_queued++; - if (rq->cmd_flags & REQ_META) - cfqq->meta_pending++; + if (rq->cmd_flags & REQ_PRIO) + cfqq->prio_pending++; cfq_update_io_thinktime(cfqd, cic); cfq_update_io_seektime(cfqd, cfqq, rq); |