X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fblock%2Fas-iosched.c;h=0ef6a665d93e03ed03dabb0fb5c179f1416fdd8b;hb=720b94a4e7548e78be55ab8fd3be4686c57dc808;hp=5d13891efc22816e91799eef43753e25f611d918;hpb=86090fcac5e27b630656fe3d963a6b80e26dac44;p=linux-2.6.git diff --git a/drivers/block/as-iosched.c b/drivers/block/as-iosched.c index 5d13891ef..0ef6a665d 100644 --- a/drivers/block/as-iosched.c +++ b/drivers/block/as-iosched.c @@ -43,7 +43,7 @@ * read_batch_expire describes how long we will allow a stream of reads to * persist before looking to see whether it is time to switch over to writes. */ -#define default_read_batch_expire (HZ / 4) +#define default_read_batch_expire (HZ / 2) /* * write_batch_expire describes how long we want a stream of writes to run for. @@ -51,7 +51,7 @@ * See, the problem is: we can send a lot of writes to disk cache / TCQ in * a short amount of time... */ -#define default_write_batch_expire (HZ / 16) +#define default_write_batch_expire (HZ / 8) /* * max time we may wait to anticipate a read (default around 6ms) @@ -1216,13 +1216,12 @@ static void as_move_to_dispatch(struct as_data *ad, struct as_rq *arq) } as_remove_queued_request(ad->q, rq); + WARN_ON(arq->state != AS_RQ_QUEUED); + list_add(&rq->queuelist, insert); + arq->state = AS_RQ_DISPATCHED; if (arq->io_context && arq->io_context->aic) atomic_inc(&arq->io_context->aic->nr_dispatched); - - WARN_ON(arq->state != AS_RQ_QUEUED); - arq->state = AS_RQ_DISPATCHED; - ad->nr_dispatched++; } @@ -1492,6 +1491,21 @@ static void as_requeue_request(request_queue_t *q, struct request *rq) as_antic_stop(ad); } +/* + * Account a request that is inserted directly onto the dispatch queue. + * arq->io_context->aic->nr_dispatched should not need to be incremented + * because only new requests should come through here: requeues go through + * our explicit requeue handler. + */ +static void as_account_queued_request(struct as_data *ad, struct request *rq) +{ + if (blk_fs_request(rq)) { + struct as_rq *arq = RQ_DATA(rq); + arq->state = AS_RQ_DISPATCHED; + ad->nr_dispatched++; + } +} + static void as_insert_request(request_queue_t *q, struct request *rq, int where) { @@ -1522,10 +1536,12 @@ as_insert_request(request_queue_t *q, struct request *rq, int where) as_move_to_dispatch(ad, ad->next_arq[REQ_ASYNC]); list_add_tail(&rq->queuelist, ad->dispatch); + as_account_queued_request(ad, rq); as_antic_stop(ad); break; case ELEVATOR_INSERT_FRONT: list_add(&rq->queuelist, ad->dispatch); + as_account_queued_request(ad, rq); as_antic_stop(ad); break; case ELEVATOR_INSERT_SORT: