Displaying 20 results from an estimated 59 matches for "out_free_vq".
Did you mean:
out_free_vb
2011 Jun 01
6
[PATCH 1/1] [virt] virtio-blk: Use ida to allocate disk index
...e *vdev)
vblk->disk->private_data = vblk;
vblk->disk->fops = &virtblk_fops;
vblk->disk->driverfs_dev = &vdev->dev;
- index++;
+ vblk->index = index;
/* configure queue flush support */
if (virtio_has_feature(vdev, VIRTIO_BLK_F_FLUSH))
@@ -516,6 +535,10 @@ out_free_vq:
vdev->config->del_vqs(vdev);
out_free_vblk:
kfree(vblk);
+out_free_index:
+ spin_lock(&vd_index_lock);
+ ida_remove(&vd_index_ida, index);
+ spin_unlock(&vd_index_lock);
out:
return err;
}
@@ -529,6 +552,10 @@ static void __devexit virtblk_remove(struct virtio_device *vd...
2011 Jun 01
6
[PATCH 1/1] [virt] virtio-blk: Use ida to allocate disk index
...e *vdev)
vblk->disk->private_data = vblk;
vblk->disk->fops = &virtblk_fops;
vblk->disk->driverfs_dev = &vdev->dev;
- index++;
+ vblk->index = index;
/* configure queue flush support */
if (virtio_has_feature(vdev, VIRTIO_BLK_F_FLUSH))
@@ -516,6 +535,10 @@ out_free_vq:
vdev->config->del_vqs(vdev);
out_free_vblk:
kfree(vblk);
+out_free_index:
+ spin_lock(&vd_index_lock);
+ ida_remove(&vd_index_ida, index);
+ spin_unlock(&vd_index_lock);
out:
return err;
}
@@ -529,6 +552,10 @@ static void __devexit virtblk_remove(struct virtio_device *vd...
2012 May 03
1
[PATCH v2] virtio-blk: Fix hot-unplug race in remove method
...ic int __devinit virtblk_probe(struct virtio_device *vdev)
if (err)
goto out_free_vblk;
- vblk->pool = mempool_create_kmalloc_pool(1,sizeof(struct virtblk_req));
+ vblk->pool = mempool_create_kmalloc_pool(1, sizeof(struct virtblk_req));
if (!vblk->pool) {
err = -ENOMEM;
goto out_free_vq;
@@ -576,20 +576,30 @@ static void __devexit virtblk_remove(struct virtio_device *vdev)
{
struct virtio_blk *vblk = vdev->priv;
int index = vblk->index;
+ struct virtblk_req *vbr;
/* Prevent config work handler from accessing the device. */
mutex_lock(&vblk->config_lock);...
2012 May 03
1
[PATCH v2] virtio-blk: Fix hot-unplug race in remove method
...ic int __devinit virtblk_probe(struct virtio_device *vdev)
if (err)
goto out_free_vblk;
- vblk->pool = mempool_create_kmalloc_pool(1,sizeof(struct virtblk_req));
+ vblk->pool = mempool_create_kmalloc_pool(1, sizeof(struct virtblk_req));
if (!vblk->pool) {
err = -ENOMEM;
goto out_free_vq;
@@ -576,20 +576,30 @@ static void __devexit virtblk_remove(struct virtio_device *vdev)
{
struct virtio_blk *vblk = vdev->priv;
int index = vblk->index;
+ struct virtblk_req *vbr;
/* Prevent config work handler from accessing the device. */
mutex_lock(&vblk->config_lock);...
2008 Jan 31
4
[PATCH] virtio_blk: Dont waste major numbers
...ruct virtio_blk *vblk;
- int err, major;
+ int err;
u64 cap;
u32 v;
+ if (minor >= 1 << MINORBITS)
+ return -ENOSPC;
+
vdev->priv = vblk = kmalloc(sizeof(*vblk), GFP_KERNEL);
if (!vblk) {
err = -ENOMEM;
@@ -200,17 +206,11 @@ static int virtblk_probe(struct virtio_d
goto out_free_vq;
}
- major = register_blkdev(0, "virtblk");
- if (major < 0) {
- err = major;
- goto out_mempool;
- }
-
/* FIXME: How many partitions? How long is a piece of string? */
- vblk->disk = alloc_disk(1 << 4);
+ vblk->disk = alloc_disk(1 << PART_BITS);
if (!vblk-...
2008 Jan 31
4
[PATCH] virtio_blk: Dont waste major numbers
...ruct virtio_blk *vblk;
- int err, major;
+ int err;
u64 cap;
u32 v;
+ if (minor >= 1 << MINORBITS)
+ return -ENOSPC;
+
vdev->priv = vblk = kmalloc(sizeof(*vblk), GFP_KERNEL);
if (!vblk) {
err = -ENOMEM;
@@ -200,17 +206,11 @@ static int virtblk_probe(struct virtio_d
goto out_free_vq;
}
- major = register_blkdev(0, "virtblk");
- if (major < 0) {
- err = major;
- goto out_mempool;
- }
-
/* FIXME: How many partitions? How long is a piece of string? */
- vblk->disk = alloc_disk(1 << 4);
+ vblk->disk = alloc_disk(1 << PART_BITS);
if (!vblk-...
2012 May 03
2
[PATCH 1/2] virtio-blk: Fix hot-unplug race in remove method
...ic int __devinit virtblk_probe(struct virtio_device *vdev)
if (err)
goto out_free_vblk;
- vblk->pool = mempool_create_kmalloc_pool(1,sizeof(struct virtblk_req));
+ vblk->pool = mempool_create_kmalloc_pool(1, sizeof(struct virtblk_req));
if (!vblk->pool) {
err = -ENOMEM;
goto out_free_vq;
@@ -466,6 +471,7 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
virtblk_name_format("vd", index, vblk->disk->disk_name, DISK_NAME_LEN);
+ vblk->req_in_flight = 0;
vblk->disk->major = major;
vblk->disk->first_minor = index_to_minor(index);...
2012 May 03
2
[PATCH 1/2] virtio-blk: Fix hot-unplug race in remove method
...ic int __devinit virtblk_probe(struct virtio_device *vdev)
if (err)
goto out_free_vblk;
- vblk->pool = mempool_create_kmalloc_pool(1,sizeof(struct virtblk_req));
+ vblk->pool = mempool_create_kmalloc_pool(1, sizeof(struct virtblk_req));
if (!vblk->pool) {
err = -ENOMEM;
goto out_free_vq;
@@ -466,6 +471,7 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
virtblk_name_format("vd", index, vblk->disk->disk_name, DISK_NAME_LEN);
+ vblk->req_in_flight = 0;
vblk->disk->major = major;
vblk->disk->first_minor = index_to_minor(index);...
2014 Mar 14
4
[PATCH] virtio-blk: Initialize blkqueue depth from virtqueue size
virtio-blk set the default queue depth to 64 requests, which was
insufficient for high-IOPS devices. Instead set the blk-queue depth to
the device's virtqueue depth divided by two (each I/O requires at least
two VQ entries).
Signed-off-by: Venkatesh Srinivas <venkateshs at google.com>
---
drivers/block/virtio_blk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
2014 Mar 14
4
[PATCH] virtio-blk: Initialize blkqueue depth from virtqueue size
virtio-blk set the default queue depth to 64 requests, which was
insufficient for high-IOPS devices. Instead set the blk-queue depth to
the device's virtqueue depth divided by two (each I/O requires at least
two VQ entries).
Signed-off-by: Venkatesh Srinivas <venkateshs at google.com>
---
drivers/block/virtio_blk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
2008 Jan 08
1
[PATCH] kvm guest balloon driver
...init_waitqueue_head(&virtballoon.balloon_wait);
+ init_waitqueue_head(&virtballoon.rmmod_wait);
+ atomic_set(&virtballoon.inflight_bufs, 0);
+
+ err = request_irq(pvdev->pci_dev->irq, balloon_irq, IRQF_SHARED,
+ pvdev->vdev.dev.bus_id, &virtballoon);
+ if (err)
+ goto out_free_vq;
+
+ virtballoon.balloon_thread = kthread_run(balloon_thread,
+ &virtballoon,
+ "kvm_balloond");
+ printk("kvm_balloon: registered\n");
+
+ return 0;
+
+out_free_vq:
+ vdev->config->del_vq(virtballoon.vq);
+ virtballoon.dev = NULL;
+ return err;
+}
+
+stati...
2008 Jan 08
1
[PATCH] kvm guest balloon driver
...init_waitqueue_head(&virtballoon.balloon_wait);
+ init_waitqueue_head(&virtballoon.rmmod_wait);
+ atomic_set(&virtballoon.inflight_bufs, 0);
+
+ err = request_irq(pvdev->pci_dev->irq, balloon_irq, IRQF_SHARED,
+ pvdev->vdev.dev.bus_id, &virtballoon);
+ if (err)
+ goto out_free_vq;
+
+ virtballoon.balloon_thread = kthread_run(balloon_thread,
+ &virtballoon,
+ "kvm_balloond");
+ printk("kvm_balloon: registered\n");
+
+ return 0;
+
+out_free_vq:
+ vdev->config->del_vq(virtballoon.vq);
+ virtballoon.dev = NULL;
+ return err;
+}
+
+stati...
2009 May 14
1
[PATCHv6 2/4] virtio: find_vqs/del_vqs virtio operations
...ig->find_vq(vdev, 0, blk_done, "requests");
+ vblk->vq = virtio_find_single_vq(vdev, blk_done, "requests");
if (IS_ERR(vblk->vq)) {
err = PTR_ERR(vblk->vq);
goto out_free_vblk;
@@ -323,7 +323,7 @@ out_put_disk:
out_mempool:
mempool_destroy(vblk->pool);
out_free_vq:
- vdev->config->del_vq(vblk->vq);
+ vdev->config->del_vqs(vdev);
out_free_vblk:
kfree(vblk);
out:
@@ -344,7 +344,7 @@ static void virtblk_remove(struct virtio_device *vdev)
blk_cleanup_queue(vblk->disk->queue);
put_disk(vblk->disk);
mempool_destroy(vblk->pool);...
2009 May 14
1
[PATCHv6 2/4] virtio: find_vqs/del_vqs virtio operations
...ig->find_vq(vdev, 0, blk_done, "requests");
+ vblk->vq = virtio_find_single_vq(vdev, blk_done, "requests");
if (IS_ERR(vblk->vq)) {
err = PTR_ERR(vblk->vq);
goto out_free_vblk;
@@ -323,7 +323,7 @@ out_put_disk:
out_mempool:
mempool_destroy(vblk->pool);
out_free_vq:
- vdev->config->del_vq(vblk->vq);
+ vdev->config->del_vqs(vdev);
out_free_vblk:
kfree(vblk);
out:
@@ -344,7 +344,7 @@ static void virtblk_remove(struct virtio_device *vdev)
blk_cleanup_queue(vblk->disk->queue);
put_disk(vblk->disk);
mempool_destroy(vblk->pool);...
2020 Jun 15
0
[PATCH] virtio-blk: free vblk-vqs in error path of virtblk_probe()
...-git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index 9d21bf0f155e..980df853ee49 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -878,6 +878,7 @@ static int virtblk_probe(struct virtio_device *vdev)
> put_disk(vblk->disk);
> out_free_vq:
> vdev->config->del_vqs(vdev);
> + kfree(vblk->vqs);
> out_free_vblk:
> kfree(vblk);
> out_free_index:
> --
> 2.25.0.4.g0ad7144999
>
The patch LGTM:
Reviewed-by: Stefano Garzarella <sgarzare at redhat.com>
2020 Jun 30
0
[PATCH] virtio-blk: free vblk-vqs in error path of virtblk_probe()
...-git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index 9d21bf0f155e..980df853ee49 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -878,6 +878,7 @@ static int virtblk_probe(struct virtio_device *vdev)
> put_disk(vblk->disk);
> out_free_vq:
> vdev->config->del_vqs(vdev);
> + kfree(vblk->vqs);
> out_free_vblk:
> kfree(vblk);
> out_free_index:
> --
> 2.25.0.4.g0ad7144999
>
Reviewed-by: Ming Lei <ming.lei at redhat.com>
--
Ming
2014 Mar 14
2
[PATCH] virtio-blk: make the queue depth configurable
...= {
.free_hctx = blk_mq_free_single_hw_queue,
};
+static int queue_depth = 64;
+module_param(queue_depth, int, 444);
+
static struct blk_mq_reg virtio_mq_reg = {
.ops = &virtio_mq_ops,
.nr_hw_queues = 1,
@@ -551,6 +554,7 @@ static int virtblk_probe(struct virtio_device *vdev)
goto out_free_vq;
}
+ virtio_mq_reg.queue_depth = queue_depth;
virtio_mq_reg.cmd_size =
sizeof(struct virtblk_req) +
sizeof(struct scatterlist) * sg_elems;
--
1.9.0
2014 Mar 15
0
[PATCH] virtio-blk: make the queue depth the max supportable by the hypervisor
...{
.free_hctx = blk_mq_free_single_hw_queue,
};
+static int queue_depth = -1;
+module_param(queue_depth, int, 0444);
+
static struct blk_mq_reg virtio_mq_reg = {
.ops = &virtio_mq_ops,
.nr_hw_queues = 1,
@@ -551,9 +554,14 @@ static int virtblk_probe(struct virtio_device *vdev)
goto out_free_vq;
}
+ virtio_mq_reg.queue_depth = queue_depth > 0 ? queue_depth :
+ (vblk->vq->num_free / 2);
virtio_mq_reg.cmd_size =
sizeof(struct virtblk_req) +
sizeof(struct scatterlist) * sg_elems;
+ virtblk_name_format("vd", index, vblk->disk->disk_name, DISK_NAME_LEN);
+...
2014 Mar 14
2
[PATCH] virtio-blk: make the queue depth configurable
...= {
.free_hctx = blk_mq_free_single_hw_queue,
};
+static int queue_depth = 64;
+module_param(queue_depth, int, 444);
+
static struct blk_mq_reg virtio_mq_reg = {
.ops = &virtio_mq_ops,
.nr_hw_queues = 1,
@@ -551,6 +554,7 @@ static int virtblk_probe(struct virtio_device *vdev)
goto out_free_vq;
}
+ virtio_mq_reg.queue_depth = queue_depth;
virtio_mq_reg.cmd_size =
sizeof(struct virtblk_req) +
sizeof(struct scatterlist) * sg_elems;
--
1.9.0
2014 Mar 15
1
[PATCH] virtio-blk: make the queue depth the max supportable by the hypervisor
...t; };
>
>+static int queue_depth = -1;
>+module_param(queue_depth, int, 0444);
?
>+
> static struct blk_mq_reg virtio_mq_reg = {
> .ops = &virtio_mq_ops,
> .nr_hw_queues = 1,
>@@ -551,9 +554,14 @@ static int virtblk_probe(struct virtio_device
>*vdev)
> goto out_free_vq;
> }
>
>+ virtio_mq_reg.queue_depth = queue_depth > 0 ? queue_depth :
>+ (vblk->vq->num_free / 2);
> virtio_mq_reg.cmd_size =
> sizeof(struct virtblk_req) +
> sizeof(struct scatterlist) * sg_elems;
>+ virtblk_name_format("vd", index, vblk->disk-...