lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54E6160E.2000600@cantab.net>
Date:	Thu, 19 Feb 2015 16:57:50 +0000
From:	David Vrabel <dvrabel@...tab.net>
To:	Bob Liu <bob.liu@...cle.com>, xen-devel@...ts.xen.org
CC:	hch@...radead.org, felipe.franciosi@...rix.com,
	linux-kernel@...r.kernel.org, axboe@...com,
	david.vrabel@...rix.com, avanzini.arianna@...il.com,
	roger.pau@...rix.com
Subject: 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ