Re: [PATCH] as i/o hang with aacraid driver 2.6.0-test1

Daniel McNeil
2003-07-17T23:31:29Z

On Thu, 2003-07-17 at 15:39, Mark Haverkamp wrote:
>
> ===== drivers/block/as-iosched.c 1.5 vs edited =====
> --- 1.5/drivers/block/as-iosched.c Sat Jul 12 04:28:01 2003
> +++ edited/drivers/block/as-iosched.c Thu Jul 17 15:31:27 2003
> @@ -1306,6 +1306,29 @@
> as_update_arq(ad, arq); /* keep state machine up to date */
> }
>
> +/*
> + * requeue the request. The request has not been completed, nor is it a
> + * new request, so don't touch accounting.
> + */
> +static void as_requeue_request(request_queue_t *q, struct request *rq)
> +{
> + struct as_data *ad = q->elevator.elevator_data;
> + struct as_rq *arq = RQ_DATA(rq);
> +
> + if (arq && arq->io_context && arq->io_context->aic)
> + atomic_inc(&arq->io_context->aic->nr_dispatched);
> +
> + list_add(&rq->queuelist, ad->dispatch->prev);
> +
> + /* Stop anticipating - let this request get through */
> + if (!list_empty(ad->dispatch)
> + && (ad->antic_status == ANTIC_WAIT_REQ
> + || ad->antic_status == ANTIC_WAIT_NEXT))
> + as_antic_stop(ad);
> +
> + return;
> +}
> +

2 questions:

Should
list_add(&rq->queuelist, ad->dispatch->prev);
be
list_add_tail(&rq->queuelist, ad->dispatch);

It is equivalent, but makes the code clearer that we're adding to the
end.

Also, isn't the: !list_empty(ad->dispatch) unnecessary since a
list_add was just done, so the list cannot be empty?

Daniel <daniel@osdl.org>