[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 07/10] xen/blkback: pseudo support for multi hardware queues





On 15/02/2015 08:19, Bob Liu wrote:
Prepare patch for multi hardware queues, the ring number was mandatory set to 1.
[...]
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -107,21 +110,108 @@ static void xen_update_blkif_status(struct xen_blkif 
*blkif)
        }
        invalidate_inode_pages2(blkif->vbd.bdev->bd_inode->i_mapping);

-       blkif->ring.xenblkd = kthread_run(xen_blkif_schedule, &blkif->ring, 
"%s", name);
-       if (IS_ERR(blkif->ring.xenblkd)) {
-               err = PTR_ERR(blkif->ring.xenblkd);
-               blkif->ring.xenblkd = NULL;
-               xenbus_dev_error(blkif->be->dev, err, "start xenblkd");
-               return;
+       if (blkif->nr_rings == 1) {
+               blkif->rings[0].xenblkd = kthread_run(xen_blkif_schedule, 
&blkif->rings[0], "%s", name);
+               if (IS_ERR(blkif->rings[0].xenblkd)) {
+                       err = PTR_ERR(blkif->rings[0].xenblkd);
+                       blkif->rings[0].xenblkd = NULL;
+                       xenbus_dev_error(blkif->be->dev, err, "start xenblkd");
+                       return;
+               }

You don't need to special case 1 ring here.

+       } else {
+               for (i = 0 ; i < blkif->nr_rings ; i++) {
+                       snprintf(per_ring_name, TASK_COMM_LEN + 1, "%s-%d", 
name, i);
+                       ring = &blkif->rings[i];
+                       ring->xenblkd = kthread_run(xen_blkif_schedule, ring, 
"%s", per_ring_name);

You don't need the snprintf since kthread_run already takes a printf style name.

David

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.