[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] RE: [Xen-devel] poor domU VBD performance.
> > I've checked in something along the lines of what you > described into > > both the 2.0-testing and the unstable trees. Looks to have > identical > > performance to the original simple patch, at least for a bulk 'dd'. > > Can you post the patch here for review? Or just point me > somewhere I can view it. Jens, Thanks for your help on this. Here's Keirs updated patch: http://xen.bkbits.net:8080/xen-2.0-testing.bk/gnupatch@424c1abd7LgWMiask LEEAAX7ffdkXQ Which is based on this earlier patch from you: http://xen.bkbits.net:8080/xen-2.0-testing.bk/gnupatch@424bba4091aV1FuNk sY_4w_z4Tvr3g Best, Ian diff -Naru a/linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c b/linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c --- a/linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c2005-03-31 09:52:27 -08:00 +++ b/linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c2005-03-31 09:52:27 -08:00 @@ -481,7 +481,6 @@ for ( i = 0; i < nr_psegs; i++ ) { struct bio *bio; - struct bio_vec *bv; bio = bio_alloc(GFP_ATOMIC, 1); if ( unlikely(bio == NULL) ) @@ -494,17 +493,14 @@ bio->bi_private = pending_req; bio->bi_end_io = end_block_io_op; bio->bi_sector = phys_seg[i].sector_number; - bio->bi_rw = operation; - bv = bio_iovec_idx(bio, 0); - bv->bv_page = virt_to_page(MMAP_VADDR(pending_idx, i)); - bv->bv_len = phys_seg[i].nr_sects << 9; - bv->bv_offset = phys_seg[i].buffer & ~PAGE_MASK; + bio_add_page( + bio, + virt_to_page(MMAP_VADDR(pending_idx, i)), + phys_seg[i].nr_sects << 9, + phys_seg[i].buffer & ~PAGE_MASK); - bio->bi_size = bv->bv_len; - bio->bi_vcnt++; - - submit_bio(operation, bio); + submit_bio(operation | (1 << BIO_RW_SYNC), bio); } #endif # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/03/31 09:52:16+01:00 kaf24@xxxxxxxxxxxxxxxxxxxx # Backport of Jens blkdev performance patch. I accidentally applied it # first to unstable. # # linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c # 2005/03/31 09:52:15+01:00 kaf24@xxxxxxxxxxxxxxxxxxxx +6 -10 # Backport of Jens blkdev performance patch. I accidentally applied it # first to unstable. # diff -Naru a/linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c b/linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c --- a/linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c2005-03-31 09:54:46 -08:00 +++ b/linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c2005-03-31 09:54:46 -08:00 @@ -66,6 +66,19 @@ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) static kmem_cache_t *buffer_head_cachep; +#else +static request_queue_t *plugged_queue; +void bdev_put(struct block_device *bdev) +{ + request_queue_t *q = plugged_queue; + /* We might be giving up last reference to plugged queue. Flush if so. */ + if ( (q != NULL) && + (q == bdev_get_queue(bdev)) && + (cmpxchg(&plugged_queue, q, NULL) == q) ) + blk_run_queue(q); + /* It's now safe to drop the block device. */ + blkdev_put(bdev); +} #endif static int do_block_io_op(blkif_t *blkif, int max_to_do); @@ -176,9 +189,15 @@ blkif_put(blkif); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) /* Push the batch through to disc. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) run_task_queue(&tq_disk); +#else + if ( plugged_queue != NULL ) + { + blk_run_queue(plugged_queue); + plugged_queue = NULL; + } #endif } } @@ -481,6 +500,7 @@ for ( i = 0; i < nr_psegs; i++ ) { struct bio *bio; + request_queue_t *q; bio = bio_alloc(GFP_ATOMIC, 1); if ( unlikely(bio == NULL) ) @@ -500,7 +520,14 @@ phys_seg[i].nr_sects << 9, phys_seg[i].buffer & ~PAGE_MASK); - submit_bio(operation | (1 << BIO_RW_SYNC), bio); + if ( (q = bdev_get_queue(bio->bi_bdev)) != plugged_queue ) + { + if ( plugged_queue != NULL ) + blk_run_queue(plugged_queue); + plugged_queue = q; + } + + submit_bio(operation, bio); } #endif diff -Naru a/linux-2.6.11-xen-sparse/drivers/xen/blkback/common.h b/linux-2.6.11-xen-sparse/drivers/xen/blkback/common.h --- a/linux-2.6.11-xen-sparse/drivers/xen/blkback/common.h2005-03-31 09:54:46 -08:00 +++ b/linux-2.6.11-xen-sparse/drivers/xen/blkback/common.h2005-03-31 09:54:46 -08:00 @@ -30,8 +30,10 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) typedef struct rb_root rb_root_t; typedef struct rb_node rb_node_t; +extern void bdev_put(struct block_device *bdev); #else struct block_device; +#define bdev_put(_b) ((void)0) #endif typedef struct blkif_st { diff -Naru a/linux-2.6.11-xen-sparse/drivers/xen/blkback/vbd.c b/linux-2.6.11-xen-sparse/drivers/xen/blkback/vbd.c --- a/linux-2.6.11-xen-sparse/drivers/xen/blkback/vbd.c2005-03-31 09:54:46 -08:00 +++ b/linux-2.6.11-xen-sparse/drivers/xen/blkback/vbd.c2005-03-31 09:54:46 -08:00 @@ -150,7 +150,7 @@ { DPRINTK("vbd_grow: device %08x doesn't exist.\n", x->extent.device); grow->status = BLKIF_BE_STATUS_EXTENT_NOT_FOUND; - blkdev_put(x->bdev); + bdev_put(x->bdev); goto out; } @@ -255,7 +255,7 @@ *px = x->next; /* ATOMIC: no need for vbd_lock. */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - blkdev_put(x->bdev); + bdev_put(x->bdev); #endif kfree(x); @@ -307,7 +307,7 @@ { t = x->next; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - blkdev_put(x->bdev); + bdev_put(x->bdev); #endif kfree(x); x = t; @@ -335,7 +335,7 @@ { t = x->next; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - blkdev_put(x->bdev); + bdev_put(x->bdev); #endif kfree(x); x = t; # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/03/31 16:43:57+01:00 kaf24@xxxxxxxxxxxxxxxxxxxx # Backport of batched request_queue unplugging in blkback driver. # Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> # # linux-2.6.11-xen-sparse/drivers/xen/blkback/blkback.c # 2005/03/31 16:43:56+01:00 kaf24@xxxxxxxxxxxxxxxxxxxx +29 -2 # Backport of batched request_queue unplugging in blkback driver. # Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> # # linux-2.6.11-xen-sparse/drivers/xen/blkback/common.h # 2005/03/31 16:43:56+01:00 kaf24@xxxxxxxxxxxxxxxxxxxx +2 -0 # Backport of batched request_queue unplugging in blkback driver. # Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> # # linux-2.6.11-xen-sparse/drivers/xen/blkback/vbd.c # 2005/03/31 16:43:56+01:00 kaf24@xxxxxxxxxxxxxxxxxxxx +4 -4 # Backport of batched request_queue unplugging in blkback driver. # Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> # _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |