All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] [patch 1/3] uml-ubd-no-empty-queue
@ 2004-09-06 17:44 ` blaisorblade_spam
  0 siblings, 0 replies; 14+ messages in thread
From: blaisorblade_spam @ 2004-09-06 17:44 UTC (permalink / raw)
  To: akpm; +Cc: jdike, linux-kernel, user-mode-linux-devel, blaisorblade_spam


Avoid using, in the UBD driver, the elv_queue_empty function. It's for
the block layer only; in fact, the Anticipatory Scheduler can return NULL
with elv_next_request() even if the queue is not empty, because it waits
for the process to send another request before seeking on the disk.

In fact, if (with uml-ubd-any-elevator) we let UBD use any scheduler,
elevator=as will make the UBD driver Oops, if we don't have this patch.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>
---

 uml-linux-2.6.8.1-paolo/arch/um/drivers/ubd_kern.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff -puN arch/um/drivers/ubd_kern.c~uml-ubd-no-empty-queue arch/um/drivers/ubd_kern.c
--- uml-linux-2.6.8.1/arch/um/drivers/ubd_kern.c~uml-ubd-no-empty-queue	2004-08-29 14:40:51.313410952 +0200
+++ uml-linux-2.6.8.1-paolo/arch/um/drivers/ubd_kern.c	2004-08-29 14:40:51.315410648 +0200
@@ -1038,8 +1038,7 @@ static void do_ubd_request(request_queue
 	int err, n;
 
 	if(thread_fd == -1){
-		while(!elv_queue_empty(q)){
-			req = elv_next_request(q);
+		while((req = elv_next_request(q)) != NULL){
 			err = prepare_request(req, &io_req);
 			if(!err){
 				do_io(&io_req);
@@ -1048,9 +1047,8 @@ static void do_ubd_request(request_queue
 		}
 	}
 	else {
-		if(do_ubd || elv_queue_empty(q))
+		if(do_ubd || (req = elv_next_request(q)) == NULL)
 			return;
-		req = elv_next_request(q);
 		err = prepare_request(req, &io_req);
 		if(!err){
 			do_ubd = ubd_handler;
_


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2004-09-07 21:29 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-06 17:44 [uml-devel] [patch 1/3] uml-ubd-no-empty-queue blaisorblade_spam
2004-09-06 17:44 ` blaisorblade_spam
2004-09-06 21:26 ` [uml-devel] " Andrew Morton
2004-09-06 21:26   ` Andrew Morton
2004-09-07  2:26   ` [uml-devel] " Jeff Garzik
2004-09-07  2:26     ` Jeff Garzik
2004-09-07 18:04   ` [uml-devel] " BlaisorBlade
2004-09-07 18:04     ` BlaisorBlade
2004-09-07 21:23     ` Andrew Morton
2004-09-07 21:23       ` Andrew Morton
2004-09-07  9:35 ` Jens Axboe
2004-09-07  9:35   ` Jens Axboe
2004-09-07 18:50   ` [uml-devel] " BlaisorBlade
2004-09-07 18:50     ` BlaisorBlade

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.