Thanks for looking at this so promptly. I have downloaded and tested your kernel. It appears to work well both with scsi mq enabled and disabled (over virtio-scsi). I also ran some basic io integrity tests and didn't spot any problems.
Before you commit this, may I propose a v2 of my own patch which is functionally identical but slightly more elegant? It does the atomic_inc() within virtscsi_pick_vq_mq(). That's probably preferable given the other uses of atomic_*() for non-mq are done within virtscsi_pick_vq().
Have a look:
-------------8<-------------
--- old/linux-4.4.0/drivers/scsi/virtio_scsi.c 2018-06-04 10:23:07.000000000 -0700
+++ new/linux-4.4.0/drivers/scsi/virtio_scsi.c 2018-06-07 06:20:58.596764040 -0700
@@ -588,11 +588,13 @@
}
Hi Joseph,
Thanks for looking at this so promptly. I have downloaded and tested your kernel. It appears to work well both with scsi mq enabled and disabled (over virtio-scsi). I also ran some basic io integrity tests and didn't spot any problems.
Before you commit this, may I propose a v2 of my own patch which is functionally identical but slightly more elegant? It does the atomic_inc() within virtscsi_ pick_vq_ mq(). That's probably preferable given the other uses of atomic_*() for non-mq are done within virtscsi_pick_vq().
Have a look: ------8< ------- ------ 4.4.0/drivers/ scsi/virtio_ scsi.c 2018-06-04 10:23:07.000000000 -0700 4.4.0/drivers/ scsi/virtio_ scsi.c 2018-06-07 06:20:58.596764040 -0700
-------
--- old/linux-
+++ new/linux-
@@ -588,11 +588,13 @@
}
static struct virtio_scsi_vq *virtscsi_ pick_vq_ mq(struct virtio_scsi *vscsi, scsi_target_ state *tgt,
struct scsi_cmnd *sc) unique_ tag(sc- >request) ; unique_ tag_to_ hwq(tag) ;
+ struct virtio_
{
u32 tag = blk_mq_
u16 hwq = blk_mq_
+ atomic_ inc(&tgt- >reqs); >req_vqs[ hwq];
return &vscsi-
}
@@ -642,7 +644,7 @@
struct virtio_scsi_vq *req_vq;
if (shost_ use_blk_ mq(sh)) pick_vq_ mq(vscsi, sc); pick_vq_ mq(vscsi, tgt, sc);
req_vq = virtscsi_ pick_vq( vscsi, tgt);
- req_vq = virtscsi_
+ req_vq = virtscsi_
else
Signed-off-by: Felipe Franciosi <email address hidden>
------- ------8< ------- ------
I'm happy to test it again if you'd like, but it should be functionally identical.