Displaying 20 results from an estimated 41 matches for "blk_mq_stop_hw_queue".
2020 Feb 13
7
[PATCH 0/2] virtio-blk: improve handling of DMA mapping failures
Two patches are handling new edge cases introduced by doing DMA mappings
(which can fail) in virtio core.
I stumbled upon this while stress testing I/O for Protected Virtual
Machines. I deliberately chose a tiny swiotlb size and have generated
load with fio. With more than one virtio-blk disk in use I experienced
hangs.
The goal of this series is to fix those hangs.
Halil Pasic (2):
2020 Feb 13
7
[PATCH 0/2] virtio-blk: improve handling of DMA mapping failures
Two patches are handling new edge cases introduced by doing DMA mappings
(which can fail) in virtio core.
I stumbled upon this while stress testing I/O for Protected Virtual
Machines. I deliberately chose a tiny swiotlb size and have generated
load with fio. With more than one virtio-blk disk in use I experienced
hangs.
The goal of this series is to fix those hangs.
Halil Pasic (2):
2020 Feb 14
1
[PATCH 1/2] virtio-blk: fix hw_queue stopped on arbitrary error
...ivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -245,10 +245,12 @@ static blk_status_t virtio_queue_rq(struct blk_mq_hw_ctx *hctx,
> err = virtblk_add_req(vblk->vqs[qid].vq, vbr, vbr->sg, num);
> if (err) {
> virtqueue_kick(vblk->vqs[qid].vq);
> - blk_mq_stop_hw_queue(hctx);
> + /* Don't stop the queue if -ENOMEM: we may have failed to
> + * bounce the buffer due to global resource outage.
> + */
> + if (err == -ENOSPC)
> + blk_mq_stop_hw_queue(hctx);
> spin_unlock_irqrestore(&vblk->vqs[qid].lock, flags);
> - /* Out of...
2020 Feb 13
0
[PATCH 1/2] virtio-blk: fix hw_queue stopped on arbitrary error
.....adfe43f5ffe4 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -245,10 +245,12 @@ static blk_status_t virtio_queue_rq(struct blk_mq_hw_ctx *hctx,
err = virtblk_add_req(vblk->vqs[qid].vq, vbr, vbr->sg, num);
if (err) {
virtqueue_kick(vblk->vqs[qid].vq);
- blk_mq_stop_hw_queue(hctx);
+ /* Don't stop the queue if -ENOMEM: we may have failed to
+ * bounce the buffer due to global resource outage.
+ */
+ if (err == -ENOSPC)
+ blk_mq_stop_hw_queue(hctx);
spin_unlock_irqrestore(&vblk->vqs[qid].lock, flags);
- /* Out of mem doesn't actually happen, s...
2014 Oct 06
2
[PATCH 06/16] virtio_blk: drop config_enable
...ev);
>
> /* Prevent config work handler from accessing the device. */
dito on the comment
> - mutex_lock(&vblk->config_lock);
> - vblk->config_enable = false;
> - mutex_unlock(&vblk->config_lock);
> -
> flush_work(&vblk->config_work);
>
> blk_mq_stop_hw_queues(vblk->disk->queue);
2014 Oct 06
2
[PATCH 06/16] virtio_blk: drop config_enable
...ev);
>
> /* Prevent config work handler from accessing the device. */
dito on the comment
> - mutex_lock(&vblk->config_lock);
> - vblk->config_enable = false;
> - mutex_unlock(&vblk->config_lock);
> -
> flush_work(&vblk->config_work);
>
> blk_mq_stop_hw_queues(vblk->disk->queue);
2020 Apr 18
0
[PATCH AUTOSEL 5.5 74/75] virtio-blk: improve virtqueue error to BLK_STS
...etions(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index c2ed3e9128e3a..a55383b139df9 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -345,9 +345,14 @@ static blk_status_t virtio_queue_rq(struct blk_mq_hw_ctx *hctx,
if (err == -ENOSPC)
blk_mq_stop_hw_queue(hctx);
spin_unlock_irqrestore(&vblk->vqs[qid].lock, flags);
- if (err == -ENOMEM || err == -ENOSPC)
+ switch (err) {
+ case -ENOSPC:
return BLK_STS_DEV_RESOURCE;
- return BLK_STS_IOERR;
+ case -ENOMEM:
+ return BLK_STS_RESOURCE;
+ default:
+ return BLK_STS_IOERR;
+ }
}...
2020 Apr 18
0
[PATCH AUTOSEL 5.4 73/78] virtio-blk: improve virtqueue error to BLK_STS
...etions(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index c2ed3e9128e3a..a55383b139df9 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -345,9 +345,14 @@ static blk_status_t virtio_queue_rq(struct blk_mq_hw_ctx *hctx,
if (err == -ENOSPC)
blk_mq_stop_hw_queue(hctx);
spin_unlock_irqrestore(&vblk->vqs[qid].lock, flags);
- if (err == -ENOMEM || err == -ENOSPC)
+ switch (err) {
+ case -ENOSPC:
return BLK_STS_DEV_RESOURCE;
- return BLK_STS_IOERR;
+ case -ENOMEM:
+ return BLK_STS_RESOURCE;
+ default:
+ return BLK_STS_IOERR;
+ }
}...
2020 Apr 18
0
[PATCH AUTOSEL 4.19 45/47] virtio-blk: improve virtqueue error to BLK_STS
...etions(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 728c9a9609f0c..9a3c2b14ac378 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -277,9 +277,14 @@ static blk_status_t virtio_queue_rq(struct blk_mq_hw_ctx *hctx,
if (err == -ENOSPC)
blk_mq_stop_hw_queue(hctx);
spin_unlock_irqrestore(&vblk->vqs[qid].lock, flags);
- if (err == -ENOMEM || err == -ENOSPC)
+ switch (err) {
+ case -ENOSPC:
return BLK_STS_DEV_RESOURCE;
- return BLK_STS_IOERR;
+ case -ENOMEM:
+ return BLK_STS_RESOURCE;
+ default:
+ return BLK_STS_IOERR;
+ }
}...
2014 Oct 05
0
[PATCH 06/16] virtio_blk: drop config_enable
...freeze(struct virtio_device *vdev)
vdev->config->reset(vdev);
/* Prevent config work handler from accessing the device. */
- mutex_lock(&vblk->config_lock);
- vblk->config_enable = false;
- mutex_unlock(&vblk->config_lock);
-
flush_work(&vblk->config_work);
blk_mq_stop_hw_queues(vblk->disk->queue);
@@ -823,7 +809,6 @@ static int virtblk_restore(struct virtio_device *vdev)
struct virtio_blk *vblk = vdev->priv;
int ret;
- vblk->config_enable = true;
ret = init_vq(vdev->priv);
if (!ret)
blk_mq_start_stopped_hw_queues(vblk->disk->queue, true)...
2014 Oct 06
0
[PATCH 06/16] virtio_blk: drop config_enable
...;
> dito on the comment
Same here and in -net.
Pls confirm.
> > - mutex_lock(&vblk->config_lock);
> > - vblk->config_enable = false;
> > - mutex_unlock(&vblk->config_lock);
> > -
> > flush_work(&vblk->config_work);
> >
> > blk_mq_stop_hw_queues(vblk->disk->queue);
2014 Jun 22
2
[PATCH v1 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
...- err = __virtblk_add_req(vblk->vq, vbr, vbr->sg, num);
> + spin_lock_irqsave(&vblk->vq_lock[qid], flags);
> + err = __virtblk_add_req(vblk->vq[qid], vbr, vbr->sg, num);
> if (err) {
> - virtqueue_kick(vblk->vq);
> + virtqueue_kick(vblk->vq[qid]);
> blk_mq_stop_hw_queue(hctx);
> - spin_unlock_irqrestore(&vblk->vq_lock, flags);
> + spin_unlock_irqrestore(&vblk->vq_lock[qid], flags);
> /* Out of mem doesn't actually happen, since we fall back
> * to direct descriptors */
> if (err == -ENOMEM || err == -ENOSPC)
> @@ -21...
2014 Jun 22
2
[PATCH v1 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
...- err = __virtblk_add_req(vblk->vq, vbr, vbr->sg, num);
> + spin_lock_irqsave(&vblk->vq_lock[qid], flags);
> + err = __virtblk_add_req(vblk->vq[qid], vbr, vbr->sg, num);
> if (err) {
> - virtqueue_kick(vblk->vq);
> + virtqueue_kick(vblk->vq[qid]);
> blk_mq_stop_hw_queue(hctx);
> - spin_unlock_irqrestore(&vblk->vq_lock, flags);
> + spin_unlock_irqrestore(&vblk->vq_lock[qid], flags);
> /* Out of mem doesn't actually happen, since we fall back
> * to direct descriptors */
> if (err == -ENOMEM || err == -ENOSPC)
> @@ -21...
2014 Oct 06
0
[PATCH v2 05/15] virtio_blk: drop config_enable
...set(vdev);
- /* Prevent config work handler from accessing the device. */
- mutex_lock(&vblk->config_lock);
- vblk->config_enable = false;
- mutex_unlock(&vblk->config_lock);
-
+ /* Make sure no work handler is accessing the device. */
flush_work(&vblk->config_work);
blk_mq_stop_hw_queues(vblk->disk->queue);
@@ -823,7 +809,6 @@ static int virtblk_restore(struct virtio_device *vdev)
struct virtio_blk *vblk = vdev->priv;
int ret;
- vblk->config_enable = true;
ret = init_vq(vdev->priv);
if (!ret)
blk_mq_start_stopped_hw_queues(vblk->disk->queue, true)...
2019 Dec 12
4
[PATCH] virtio-blk: remove VIRTIO_BLK_F_SCSI support
...(blk_rq_is_scsi(req))
- err = virtblk_add_req_scsi(vblk->vqs[qid].vq, vbr, vbr->sg, num);
- else
- err = virtblk_add_req(vblk->vqs[qid].vq, vbr, vbr->sg, num);
+ err = virtblk_add_req(vblk->vqs[qid].vq, vbr, vbr->sg, num);
if (err) {
virtqueue_kick(vblk->vqs[qid].vq);
blk_mq_stop_hw_queue(hctx);
@@ -404,7 +310,6 @@ static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
}
static const struct block_device_operations virtblk_fops = {
- .ioctl = virtblk_ioctl,
.owner = THIS_MODULE,
.getgeo = virtblk_getgeo,
};
@@ -683,9 +588,6 @@ static int virtblk_init_r...
2014 Jun 20
3
[PATCH v1 0/2] block: virtio-blk: support multi vq per virtio-blk
Hi,
These patches try to support multi virtual queues(multi-vq) in one
virtio-blk device, and maps each virtual queue(vq) to blk-mq's
hardware queue.
With this approach, both scalability and performance on virtio-blk
device can get improved.
For verifying the improvement, I implements virtio-blk multi-vq over
qemu's dataplane feature, and both handling host notification
from each vq and
2014 Jun 20
3
[PATCH v1 0/2] block: virtio-blk: support multi vq per virtio-blk
Hi,
These patches try to support multi virtual queues(multi-vq) in one
virtio-blk device, and maps each virtual queue(vq) to blk-mq's
hardware queue.
With this approach, both scalability and performance on virtio-blk
device can get improved.
For verifying the improvement, I implements virtio-blk multi-vq over
qemu's dataplane feature, and both handling host notification
from each vq and
2014 Jun 26
1
[PATCH v2 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
..._virtblk_add_req(vblk->vq, vbr, vbr->sg, num);
> + spin_lock_irqsave(&vblk->vqs[qid].lock, flags);
> + err = __virtblk_add_req(vblk->vqs[qid].vq, vbr, vbr->sg, num);
> if (err) {
> - virtqueue_kick(vblk->vq);
> + virtqueue_kick(vblk->vqs[qid].vq);
> blk_mq_stop_hw_queue(hctx);
> - spin_unlock_irqrestore(&vblk->vq_lock, flags);
> + spin_unlock_irqrestore(&vblk->vqs[qid].lock, flags);
> /* Out of mem doesn't actually happen, since we fall back
> * to direct descriptors */
> if (err == -ENOMEM || err == -ENOSPC)
> @@ -2...
2014 Jun 26
1
[PATCH v2 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
..._virtblk_add_req(vblk->vq, vbr, vbr->sg, num);
> + spin_lock_irqsave(&vblk->vqs[qid].lock, flags);
> + err = __virtblk_add_req(vblk->vqs[qid].vq, vbr, vbr->sg, num);
> if (err) {
> - virtqueue_kick(vblk->vq);
> + virtqueue_kick(vblk->vqs[qid].vq);
> blk_mq_stop_hw_queue(hctx);
> - spin_unlock_irqrestore(&vblk->vq_lock, flags);
> + spin_unlock_irqrestore(&vblk->vqs[qid].lock, flags);
> /* Out of mem doesn't actually happen, since we fall back
> * to direct descriptors */
> if (err == -ENOMEM || err == -ENOSPC)
> @@ -2...
2014 Jun 20
0
[PATCH v1 2/2] block: virtio-blk: support multi virt queues per virtio-blk device
...amp;vblk->vq_lock, flags);
- err = __virtblk_add_req(vblk->vq, vbr, vbr->sg, num);
+ spin_lock_irqsave(&vblk->vq_lock[qid], flags);
+ err = __virtblk_add_req(vblk->vq[qid], vbr, vbr->sg, num);
if (err) {
- virtqueue_kick(vblk->vq);
+ virtqueue_kick(vblk->vq[qid]);
blk_mq_stop_hw_queue(hctx);
- spin_unlock_irqrestore(&vblk->vq_lock, flags);
+ spin_unlock_irqrestore(&vblk->vq_lock[qid], flags);
/* Out of mem doesn't actually happen, since we fall back
* to direct descriptors */
if (err == -ENOMEM || err == -ENOSPC)
@@ -215,12 +222,12 @@ static int vir...