Skip to contentSkip to conversation

virtio_blk: don't bounce highmem requests

PATCH Applied Christoph Hellwig 2 participants 4 messages Jun 19, 2009 – Jul 8, 2009

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio_blk: don't bounce highmem requests

By default a block driver bounces highmem requests, but virtio-blk is perfectly fine with any request that fit into it's 64 bit addressing scheme, mapped in the kernel virtual space or not.

Besides improving performance on highmem systems this also makes the reproducible oops in __bounce_end_io go away (but hiding the real cause).

drivers/block/virtio_blk.c +3 -0
Index: linux-2.6/drivers/block/virtio_blk.c
===================================================================
@@ -360,6 +360,9 @@ static int __devinit virtblk_probe(struc
 	blk_queue_max_phys_segments(vblk->disk->queue, vblk->sg_elems-2);
 	blk_queue_max_hw_segments(vblk->disk->queue, vblk->sg_elems-2);
 
+	/* No need to bounce any requests */
+	blk_queue_bounce_limit(brd->brd_queue, BLK_BOUNCE_ANY);
+
 	/* No real sector limit. */
 	blk_queue_max_sectors(vblk->disk->queue, -1U);
 
#1 lore raw

Looks like I sent a patch that doesn't actually compile because qui decided to apply those fixes to a different one. Here's the correc one:

--

Subject: virtio_blk: don't bounce highmem requests
From: Christoph Hellwig <[email protected]>

By default a block driver bounces highmem requests, but virtio-blk is perfectly fine with any request that fit into it's 64 bit addressing scheme, mapped in the kernel virtual space or not.

Besides improving performance on highmem systems this also makes the reproducible oops in __bounce_end_io go away (but hiding the real cause).

drivers/block/virtio_blk.c +3 -0
Index: linux-2.6/drivers/block/virtio_blk.c
===================================================================
@@ -360,6 +360,9 @@ static int __devinit virtblk_probe(struc
 	blk_queue_max_phys_segments(vblk->disk->queue, vblk->sg_elems-2);
 	blk_queue_max_hw_segments(vblk->disk->queue, vblk->sg_elems-2);
 
+	/* No need to bounce any requests */
+	blk_queue_bounce_limit(vblk->disk->queue, BLK_BOUNCE_ANY);
+
 	/* No real sector limit. */
 	blk_queue_max_sectors(vblk->disk->queue, -1U);
 
#2 lore raw
Quoted 4 lines · Christoph Hellwig

Looks like I sent a patch that doesn't actually compile because qui decided to apply those fixes to a different one. Here's the correc one:

Quoted 8 lines

--

Subject: virtio_blk: don't bounce highmem requests
From: Christoph Hellwig <[email protected]>

By default a block driver bounces highmem requests, but virtio-blk is perfectly fine with any request that fit into it's 64 bit addressing scheme, mapped in the kernel virtual space or not.

Thanks, applied.

I had no idea we had to set a bounce limit; wonder what else the driver doesn't do?

Thanks,
Rusty.

#3 lore raw
Quoted 7 lines · Rusty Russell
Quoted 6 lines · Christoph Hellwig

Looks like I sent a patch that doesn't actually compile because qui decided to apply those fixes to a different one. Here's the correc one:

--

Quoted 8 lines
Quoted 6 lines

Subject: virtio_blk: don't bounce highmem requests
From: Christoph Hellwig <[email protected]>

By default a block driver bounces highmem requests, but virtio-blk is perfectly fine with any request that fit into it's 64 bit addressing scheme, mapped in the kernel virtual space or not.

Thanks, applied.

Can you forward it to Linus for 2.6.31? It's a trivial fix for an issue causing a lot of pain to people with highmem enabled.