summaryrefslogtreecommitdiff
path: root/drivers/block/noop-iosched.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2005-10-20 16:42:29 +0200
committerJens Axboe <axboe@nelson.home.kernel.dk>2005-10-28 08:45:08 +0200
commitb4878f245ec8e168cdd1f170f823a750b7dd4af5 (patch)
treede784c2a7e1174e4843807998f0356bf92ee78be /drivers/block/noop-iosched.c
parentd9ebb192aa13a026edc6faff137dcb14f2c91731 (diff)
downloadlwn-b4878f245ec8e168cdd1f170f823a750b7dd4af5.tar.gz
lwn-b4878f245ec8e168cdd1f170f823a750b7dd4af5.zip
[PATCH] 02/05: update ioscheds to use generic dispatch queue
This patch updates all four ioscheds to use generic dispatch queue. There's one behavior change in as-iosched. * In as-iosched, when force dispatching (ELEVATOR_INSERT_BACK), batch_data_dir is reset to REQ_SYNC and changed_batch and new_batch are cleared to zero. This prevernts AS from doing incorrect update_write_batch after the forced dispatched requests are finished. * In cfq-iosched, cfqd->rq_in_driver currently counts the number of activated (removed) requests to determine whether queue-kicking is needed and cfq_max_depth has been reached. With generic dispatch queue, I think counting the number of dispatched requests would be more appropriate. * cfq_max_depth can be lowered to 1 again. Original from Tejun Heo, modified version applied. Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'drivers/block/noop-iosched.c')
-rw-r--r--drivers/block/noop-iosched.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/block/noop-iosched.c b/drivers/block/noop-iosched.c
index b1730b62c37e..bc2252b6f2e5 100644
--- a/drivers/block/noop-iosched.c
+++ b/drivers/block/noop-iosched.c
@@ -28,13 +28,9 @@ static void elevator_noop_merge_requests(request_queue_t *q, struct request *req
list_del_init(&next->queuelist);
}
-static void elevator_noop_add_request(request_queue_t *q, struct request *rq,
- int where)
+static void elevator_noop_add_request(request_queue_t *q, struct request *rq)
{
- if (where == ELEVATOR_INSERT_FRONT)
- list_add(&rq->queuelist, &q->queue_head);
- else
- list_add_tail(&rq->queuelist, &q->queue_head);
+ elv_dispatch_add_tail(q, rq);
/*
* new merges must not precede this barrier
@@ -45,19 +41,16 @@ static void elevator_noop_add_request(request_queue_t *q, struct request *rq,
q->last_merge = rq;
}
-static struct request *elevator_noop_next_request(request_queue_t *q)
+static int elevator_noop_dispatch(request_queue_t *q, int force)
{
- if (!list_empty(&q->queue_head))
- return list_entry_rq(q->queue_head.next);
-
- return NULL;
+ return 0;
}
static struct elevator_type elevator_noop = {
.ops = {
.elevator_merge_fn = elevator_noop_merge,
.elevator_merge_req_fn = elevator_noop_merge_requests,
- .elevator_next_req_fn = elevator_noop_next_request,
+ .elevator_dispatch_fn = elevator_noop_dispatch,
.elevator_add_req_fn = elevator_noop_add_request,
},
.elevator_name = "noop",