linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] livelock in elevator scheduling
@ 2000-11-21  8:38 kumon
  2000-11-21 10:28 ` Jens Axboe
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: kumon @ 2000-11-21  8:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: Dave Jones, Andrea Arcangeli, Jens Axboe, kumon

The current elevator_linus() doesn't obey the true elevator
scheduling, and causes I/O livelock during frequent random write
traffics. In such environment I/O (read/write) transactions may be
delayed almost infinitely (more than 1 hour).

Problem:
 Current elevator_linus() traverses the I/O requesting queue from the
tail to top. And when the current request has smaller sector number
than the request on the top of queue, it is always placed just after
the top.
 This means, if requests in some sector range are continuously
generated, a request with larger sector number is always places at the
last and has no chance to go to the front.  e.g. it is not scheduled.

 This is not hypothetical but actually observed.  Running a random
disk write benchmark can completely supress other disk I/O by this
reason.


 The following patch fixes this problem. It still doesn't follow a
strict elevator scheduling, but it does much better.  Additionally, it
may be better to add extra priority to reads than writes to obtain
better response, but this patch doesn't.

diff -ru linux-2.4.0-test11-pre2/drivers/block/elevator.c linux-2.4.0-test11-pre2-test5/drivers/block/elevator.c
--- linux-2.4.0-test11-pre2/drivers/block/elevator.c	Wed Aug 23 14:33:46 2000
+++ linux-2.4.0-test11-pre2-test5/drivers/block/elevator.c	Tue Nov 21 15:32:01 2000
@@ -47,6 +47,11 @@
 			break;
 		tmp->elevator_sequence--;
 	}
+	if (entry == head) {
+		tmp = blkdev_entry_to_request(entry);
+		if (IN_ORDER(req, tmp))
+			entry = real_head->prev;
+	}
 	list_add(&req->queue, entry);
 }
 

To implement a complete elevator scheduling, preparing an alternate
waiting queue is better, I think.

--
Computer Systems Laboratory, Fujitsu Labs.
kumon@flab.fujitsu.co.jp
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 16+ messages in thread
[parent not found: <200011210828.RAA27311@asami.proc.flab.fujitsu.co.jp>]

end of thread, other threads:[~2000-12-06  1:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-21  8:38 [PATCH] livelock in elevator scheduling kumon
2000-11-21 10:28 ` Jens Axboe
2000-11-21 11:30 ` kumon
2000-11-21 11:36   ` Jens Axboe
2000-12-02  0:22     ` Russell Cattelan
2000-12-02 15:42       ` Jens Axboe
2000-12-04 23:25         ` Russell Cattelan
2000-12-05  1:38         ` Russell Cattelan
2000-12-05 23:01           ` Jens Axboe
2000-12-06  0:53             ` Russell Cattelan
2000-11-21 12:39   ` kumon
2000-11-21 13:01     ` Jens Axboe
2000-11-22  6:08     ` kumon
2000-11-22 10:59 ` kumon
2000-11-22 15:50   ` davej
     [not found] <200011210828.RAA27311@asami.proc.flab.fujitsu.co.jp>
2000-11-21 15:12 ` Andrea Arcangeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).