[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 2.6.0-test2-mm5



Andrew and or Martin, please test attached patch.
Thanks.

Nick Piggin wrote:

>
>
> Andrew Morton wrote:
>
>> "Martin J. Bligh" <mbligh@aracnet.com> wrote:
>>
>>> I get lots of these .... (without 4/4 turned on)
>>>
>>>  Badness in as_dispatch_request at drivers/block/as-iosched.c:1241
>>>
>>
>> yes, it happens with aic7xxx as well.  Sorry about that.
>>
>> You'll need to revert
>>
>
> Sorry. Worked with the sym53c8xx for me. I'll fix.
>
--- linux-2.6/drivers/block/as-iosched.c.orig	2003-08-07 18:33:06.000000000 +1000
+++ linux-2.6/drivers/block/as-iosched.c	2003-08-07 18:36:03.000000000 +1000
@@ -1198,8 +1198,10 @@ static int as_dispatch_request(struct as
 			 */
 			goto dispatch_writes;
 
- 		if (ad->batch_data_dir == REQ_ASYNC)
+ 		if (ad->batch_data_dir == REQ_ASYNC) {
+			WARN_ON(ad->new_batch || ad->changed_batch);
  			ad->changed_batch = 1;
+		}
 		ad->batch_data_dir = REQ_SYNC;
 		arq = list_entry_fifo(ad->fifo_list[ad->batch_data_dir].next);
 		ad->last_check_fifo[ad->batch_data_dir] = jiffies;
@@ -1214,8 +1216,17 @@ static int as_dispatch_request(struct as
 dispatch_writes:
 		BUG_ON(RB_EMPTY(&ad->sort_list[REQ_ASYNC]));
 
- 		if (ad->batch_data_dir == REQ_SYNC)
+ 		if (ad->batch_data_dir == REQ_SYNC) {
+			WARN_ON(ad->changed_batch);
  			ad->changed_batch = 1;
+
+			/*
+			 * new_batch might be 1 when the queue runs out of
+			 * reads. A subsequent submission of a write might
+			 * cause a change of batch before the read is finished.
+			 */
+			ad->new_batch = 0;
+		}
 		ad->batch_data_dir = REQ_ASYNC;
 		ad->current_write_count = ad->write_batch_count;
 		ad->write_batch_idled = 0;