All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/9] lguest: block device speedup
@ 2007-03-09  3:05 Rusty Russell
  2007-03-09  3:08 ` [PATCH 2/9] lguest: bridging support in example code Rusty Russell
  2007-03-09  7:51 ` [PATCH 1/9] lguest: block device speedup Christoph Hellwig
  0 siblings, 2 replies; 11+ messages in thread
From: Rusty Russell @ 2007-03-09  3:05 UTC (permalink / raw)
  To: Andrew Morton, Andi Kleen; +Cc: lkml - Kernel Mailing List, Jens Axboe

Jens Axboe pointed out that end_request() does not end the entire
request.  Go figure.  On the upside, he wrote the replacement for me!
Now we do far less block traffic, and our performance sucks less.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

diff -r fdc8cbc1fd61 drivers/block/lguest_blk.c
--- a/drivers/block/lguest_blk.c	Thu Mar 08 13:35:39 2007 +1100
+++ b/drivers/block/lguest_blk.c	Thu Mar 08 15:51:55 2007 +1100
@@ -45,6 +45,16 @@ struct blockdev
 	struct request *req;
 };
 
+/* Jens gave me this nice helper to end all chunks of a request. */
+static void end_entire_request(struct request *req, int uptodate)
+{
+	if (end_that_request_first(req, uptodate, req->hard_nr_sectors))
+		BUG();
+	add_disk_randomness(req->rq_disk);
+	blkdev_dequeue_request(req);
+	end_that_request_last(req, uptodate);
+}
+
 static irqreturn_t lgb_irq(int irq, void *_bd)
 {
 	struct blockdev *bd = _bd;
@@ -61,7 +71,7 @@ static irqreturn_t lgb_irq(int irq, void
 	}
 
 	spin_lock_irqsave(&bd->lock, flags);
-	end_request(bd->req, bd->lb_page->result == 1);
+	end_entire_request(bd->req, bd->lb_page->result == 1);
 	bd->req = NULL;
 	bd->dma.used_len = 0;
 	blk_start_queue(bd->disk->queue);
@@ -149,7 +159,7 @@ again:
 		pr_debug("Got non-command 0x%08x\n", req->cmd_type);
 	error:
 		req->errors++;
-		end_request(req, 0);
+		end_entire_request(req, 0);
 		goto again;
 	} else {
 		if (rq_data_dir(req) == WRITE)



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

end of thread, other threads:[~2007-03-09  8:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-09  3:05 [PATCH 1/9] lguest: block device speedup Rusty Russell
2007-03-09  3:08 ` [PATCH 2/9] lguest: bridging support in example code Rusty Russell
2007-03-09  3:12   ` [PATCH 3/9] lguest: cleanup: allocate separate pages for switcher code Rusty Russell
2007-03-09  3:16     ` [PATCH 4/9] lguest: cleanup: clean up regs save/restore Rusty Russell
2007-03-09  3:17       ` [PATCH 5/9] lguest: documentation fixes Rusty Russell
2007-03-09  3:19         ` [PATCH 6/9] lguest: pin stack page optimization Rusty Russell
2007-03-09  3:23           ` [PATCH 7/9] lguest: use read-only pages rather than segments to protect high-mapped switcher Rusty Russell
2007-03-09  3:30             ` [PATCH 8/9] lguest: Optimize away copy in and out of per-cpu guest pages Rusty Russell
2007-03-09  3:32               ` [PATCH 9/9] lguest: don't crash host on NMI Rusty Russell
2007-03-09  7:51 ` [PATCH 1/9] lguest: block device speedup Christoph Hellwig
2007-03-09  8:09   ` Jens Axboe

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.