public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <piggin@cyberone.com.au>
To: Jens Axboe <axboe@suse.de>, markh@osdl.org
Cc: Andrew Morton <akpm@osdl.org>,
	James.Bottomley@steeleye.com, cliffw@osdl.org,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH] as i/o hang with aacraid driver 2.6.0-test1
Date: Thu, 17 Jul 2003 21:28:06 +1000	[thread overview]
Message-ID: <3F168846.90902@cyberone.com.au> (raw)
In-Reply-To: <20030717111059.GI833@suse.de>

[-- Attachment #1: Type: text/plain, Size: 334 bytes --]



Jens Axboe wrote:

>On Thu, Jul 17 2003, Nick Piggin wrote:
>

snip

>>
>>Jens, this is exactly right. Would you be OK with this? Everyone else?
>>
>
>I'm happy with it.
>

OK, Mark, please try the following patch in combination with Jens'
previous. Untested due to not being able to exercise the requeue
path, so it might blow up.

[-- Attachment #2: as-requeue --]
[-- Type: text/plain, Size: 2265 bytes --]

--- linux-2.6/drivers/block/as-iosched.c.orig	2003-07-17 21:13:55.000000000 +1000
+++ linux-2.6/drivers/block/as-iosched.c	2003-07-17 21:24:07.000000000 +1000
@@ -1307,6 +1307,66 @@ static void as_add_request(struct as_dat
 	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);
+	int data_dir;
+
+	if (unlikely(rq->flags & REQ_HARDBARRIER)) {
+		AS_INVALIDATE_HASH(ad);
+		q->last_merge = NULL;
+
+		while (ad->next_arq[REQ_SYNC])
+			as_move_to_dispatch(ad, ad->next_arq[REQ_SYNC]);
+
+		while (ad->next_arq[REQ_ASYNC])
+			as_move_to_dispatch(ad, ad->next_arq[REQ_ASYNC]);
+	}
+
+	if (unlikely(!blk_fs_request(rq))) {
+		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;
+	}
+
+	if (rq_mergeable(rq)) {
+		as_add_arq_hash(ad, arq);
+
+		if (!q->last_merge)
+			q->last_merge = &rq->queuelist;
+	}
+
+
+	if (rq_data_dir(arq->request) == READ
+			|| current->flags&PF_SYNCWRITE)
+		arq->is_sync = 1;
+	else
+		arq->is_sync = 0;
+	data_dir = arq->is_sync;
+
+	as_add_arq_rb(ad, arq);
+
+	/*
+	 * set expire time (only used for reads) and add to fifo list
+	 */
+	arq->expires = jiffies + ad->fifo_expire[data_dir];
+	list_add_tail(&arq->fifo, &ad->fifo_list[data_dir]);
+	arq->state = AS_RQ_QUEUED;
+	as_update_arq(ad, arq); /* keep state machine up to date */
+
+}
+
 static void
 as_insert_request(request_queue_t *q, struct request *rq,
 			struct list_head *insert_here)
@@ -1822,6 +1882,7 @@ elevator_t iosched_as = {
 	.elevator_next_req_fn =		as_next_request,
 	.elevator_add_req_fn =		as_insert_request,
 	.elevator_remove_req_fn =	as_remove_request,
+	.elevator_requeue_req_fn = 	as_requeue_request,
 	.elevator_queue_empty_fn =	as_queue_empty,
 	.elevator_completed_req_fn =	as_completed_request,
 	.elevator_former_req_fn =	as_former_request,

  reply	other threads:[~2003-07-17 11:13 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-15 23:02 [PATCH] as i/o hang with aacraid driver 2.6.0-test1 Mark Haverkamp
2003-07-16  1:40 ` Nick Piggin
2003-07-16  5:53   ` Jens Axboe
2003-07-16 12:41 ` James Bottomley
2003-07-16 12:45   ` Jens Axboe
2003-07-16 12:56     ` James Bottomley
2003-07-16 13:20       ` Jens Axboe
2003-07-16 14:07         ` James Bottomley
2003-07-16 17:04           ` Jens Axboe
2003-07-17  8:57             ` Andrew Morton
2003-07-17  8:59               ` Jens Axboe
2003-07-17  9:56                 ` Nick Piggin
2003-07-17 10:29                   ` Jens Axboe
2003-07-17 10:51                     ` Nick Piggin
2003-07-17 10:56                       ` Jens Axboe
2003-07-17 11:09                         ` Nick Piggin
2003-07-17 11:11                           ` Jens Axboe
2003-07-17 11:28                             ` Nick Piggin [this message]
2003-07-17 11:29                               ` Jens Axboe
2003-07-17 14:44                               ` Mark Haverkamp
2003-07-17 15:43                                 ` James Bottomley
2003-07-17 20:46                               ` Mark Haverkamp
     [not found]                                 ` <1058481553 .19508.5.camel@markh1.pdx.osdl.net>
2003-07-17 22:39                                 ` Mark Haverkamp
2003-07-17 23:47                                   ` Daniel McNeil
2003-07-18  0:00                                     ` Andrew Morton
2003-07-18  5:14                                       ` Nick Piggin
2003-07-18  5:25                                         ` Andrew Morton
2003-07-18  5:30                                           ` Nick Piggin
2003-07-18  5:35                                             ` Nick Piggin
2003-07-18 14:16                                             ` James Bottomley
2003-07-18 16:30                                               ` Andrew Morton
2003-07-18 16:41                                                 ` James Bottomley
2003-07-18 17:25                                                   ` Alan Cox
2003-07-31  7:40                                                     ` Nick Piggin
2003-07-18 17:45                                                   ` Andrew Morton
2003-07-18 18:34                                                     ` James Bottomley
2003-07-18 14:00                                           ` James Bottomley
2003-07-18 15:03                                         ` Mark Haverkamp
2003-07-18 16:28                                           ` Mark Haverkamp
2003-07-18 16:56                                             ` James Bottomley
2003-07-18 17:46                                               ` Mark Haverkamp
2003-07-18 20:21                                                 ` James Bottomley
2003-07-18 20:39                                                   ` Christoph Hellwig
2003-07-18 20:45                                                   ` Mark Haverkamp
2003-07-19  8:26                                                   ` Jens Axboe
2003-07-31  7:16                                                   ` Nick Piggin
2003-07-31 14:28                                                     ` James Bottomley
2003-07-31 14:40                                                     ` Mark Haverkamp
2003-07-31 22:48                                                       ` Nick Piggin
2003-07-17 10:57                       ` Jens Axboe
2003-07-17 11:08                         ` Nick Piggin
2003-07-17 11:10                           ` Jens Axboe
2003-07-17 11:21                             ` Nick Piggin
2003-07-17 11:23                               ` Jens Axboe
2003-07-17 11:29                                 ` Nick Piggin
2003-07-16 22:45         ` Mark Haverkamp
2003-07-16 13:06 ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F168846.90902@cyberone.com.au \
    --to=piggin@cyberone.com.au \
    --cc=James.Bottomley@steeleye.com \
    --cc=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=cliffw@osdl.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=markh@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox