aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorTatyana Brokhman <tlinder@codeaurora.org>2013-03-12 21:02:33 +0200
committerStephen Boyd <sboyd@codeaurora.org>2013-09-04 16:07:06 -0700
commit78ed8ec260112acd08243ae37abb439b6495c6b7 (patch)
tree64a1edfd6ef1b8515e8d579549942b7e30b36467 /block
parent9ae17ef8c30424d44c750f2f82a95f5b028769b5 (diff)
downloadqcom-msm-v3.10-78ed8ec260112acd08243ae37abb439b6495c6b7.tar.gz
block: urgent request: remove unnecessary urgent marking
An urgent request is marked by the scheduler in rq->cmd_flags with the REQ_URGENT flag. There is no need to add an additional marking by the block layer. Change-Id: I05d5e9539d2f6c1bfa80240b0671db197a5d3b3f Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c8
-rw-r--r--block/blk.h11
-rw-r--r--block/elevator.c4
-rw-r--r--block/test-iosched.c2
4 files changed, 5 insertions, 20 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 5d32082ea13..04788065a1d 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2330,13 +2330,9 @@ struct request *blk_fetch_request(struct request_queue *q)
rq = blk_peek_request(q);
if (rq) {
- /*
- * Assumption: the next request fetched from scheduler after we
- * notified "urgent request pending" - will be the urgent one
- */
- if (q->notified_urgent && !q->dispatched_urgent) {
+ if (rq->cmd_flags & REQ_URGENT) {
+ WARN_ON(q->dispatched_urgent);
q->dispatched_urgent = true;
- (void)blk_mark_rq_urgent(rq);
}
blk_start_request(rq);
}
diff --git a/block/blk.h b/block/blk.h
index b733ff6c33c..e837b8f619b 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -42,7 +42,6 @@ void blk_add_timer(struct request *);
*/
enum rq_atomic_flags {
REQ_ATOM_COMPLETE = 0,
- REQ_ATOM_URGENT = 1,
};
/*
@@ -59,16 +58,6 @@ static inline void blk_clear_rq_complete(struct request *rq)
clear_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags);
}
-static inline int blk_mark_rq_urgent(struct request *rq)
-{
- return test_and_set_bit(REQ_ATOM_URGENT, &rq->atomic_flags);
-}
-
-static inline void blk_clear_rq_urgent(struct request *rq)
-{
- clear_bit(REQ_ATOM_URGENT, &rq->atomic_flags);
-}
-
/*
* Internal elevator interface
*/
diff --git a/block/elevator.c b/block/elevator.c
index 1345bbdce5c..06f43209529 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -788,10 +788,10 @@ void elv_completed_request(struct request_queue *q, struct request *rq)
{
struct elevator_queue *e = q->elevator;
- if (test_bit(REQ_ATOM_URGENT, &rq->atomic_flags)) {
+ if (rq->cmd_flags & REQ_URGENT) {
q->notified_urgent = false;
+ WARN_ON(!q->dispatched_urgent);
q->dispatched_urgent = false;
- blk_clear_rq_urgent(rq);
}
/*
* request is released from the driver, io must be done
diff --git a/block/test-iosched.c b/block/test-iosched.c
index 9b786956c18..41bdadae97a 100644
--- a/block/test-iosched.c
+++ b/block/test-iosched.c
@@ -1195,7 +1195,7 @@ static bool test_urgent_pending(struct request_queue *q)
void test_iosched_add_urgent_req(struct test_request *test_rq)
{
spin_lock_irq(&ptd->lock);
- blk_mark_rq_urgent(test_rq->rq);
+ test_rq->rq->cmd_flags |= REQ_URGENT;
list_add_tail(&test_rq->queuelist, &ptd->urgent_queue);
ptd->urgent_count++;
spin_unlock_irq(&ptd->lock);