The following patches were made over Linus's tree and also apply over
mst's vhost branch. The patches add the ability for vhost_tasks to
handle SIGKILL by flushing queued works, stop new works from being
queued, and prepare the task for an early exit.
This removes the need for the signal/coredump
p the responses and free the command's resources. When
all commands have completed then operations like flush will be woken up
and we can complete device release and endpoint cleanup.
Signed-off-by: Mike Christie
---
drivers/vhost/scsi.c | 13 -
1 file changed, 12 insertions(+),
vhost_vq_flush is no longer used so remove it.
Signed-off-by: Mike Christie
---
drivers/vhost/vhost.c | 12
drivers/vhost/vhost.h | 1 -
2 files changed, 13 deletions(-)
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 045f666b4f12..cd79075da294 100644
--- a
a
concern.
Signed-off-by: Mike Christie
---
drivers/vhost/scsi.c | 39 +++
1 file changed, 19 insertions(+), 20 deletions(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 6ec1abe7364f..04e0d3f1bd77 100644
--- a/drivers/vhost/scsi.c
+++ b
or us when the vhost_task
is killed and so userspace will not be able to handle events if we
sent them.
Signed-off-by: Mike Christie
---
drivers/vhost/scsi.c | 17 -
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 28
nding commands/TMFs have sent their responses. In that case
vhost_vq_work_queue can fail when we try to send a response.
This has us just free the TMF's resources since at this time the guest
won't be able to get a response even if we could send it.
Signed-off-by: Mike Christie
---
drivers/v
rkers
instead of the vhost_dev one.
Signed-off-by: Mike Christie
---
drivers/vhost/vhost.c | 18 --
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index cd79075da294..4252c3b827ca 100644
--- a/drivers/vhost/vhost.c
ce's close
function was called. In the previous patches vhost_tasks and the vhost
drivers were converted to support SIGKILL by cleaning themselves up and
exiting. The hacks are no longer needed so this removes them.
Signed-off-by: Mike Christie
---
fs/coredump.c | 4 +---
kernel/exit.c |
during a flush and the flush's work
is still in the queue, the worker code that will handle the SIGKILL
cleanup won't be able to take the mutex and perform it's cleanup. So
this patch has us drop the worker mutex while waiting for the flush
to complete.
Signed-off-by: Mike Christi
.
Signed-off-by: Mike Christie
---
drivers/vhost/vhost.c| 54 +---
drivers/vhost/vhost.h| 2 ++
include/linux/sched/vhost_task.h | 3 +-
kernel/vhost_task.c | 53 ---
4 files changed, 88 insertions(+), 24
On 4/8/24 11:16 PM, Jason Wang wrote:
>> It turns out only vhost-scsi had an issue where it would send a command
>> to the block/LIO layer, wait for a response and then process in the vhost
>> task.
> Vhost-net TX zerocopy code did the same:
>
> It sends zerocopy packets to the under layer and wai
On 4/11/24 3:39 AM, Jason Wang wrote:
> On Sat, Mar 16, 2024 at 8:47 AM Mike Christie
> wrote:
>>
>> The following patches were made over Linus's tree and also apply over
>> mst's vhost branch. The patches add the ability for vhost_tasks to
>> handle SI
On 4/16/24 10:50 PM, Jason Wang wrote:
> On Mon, Apr 15, 2024 at 4:52 PM Jason Wang wrote:
>>
>> On Sat, Apr 13, 2024 at 12:53 AM wrote:
>>>
>>> On 4/11/24 10:28 PM, Jason Wang wrote:
>>>> On Fri, Apr 12, 2024 at 12:19 AM Mike Christie
>>&g
along with the patches that removed the duplicated fields on
the vhost_scsd_cmd allow us to reduce mem use by 1 MB in mid size setups
where we have 16 virtqueues and are doing 1024 cmds per queue.
Signed-off-by: Mike Christie
---
drivers/vhost/scsi.c | 26 +-
1 file c
very fast (8 NVMe drives in a MD RAID0 config or a
memory backed device). As a result this patch makes the dynamic
allocation feature a modparam so userspace can decide how it wants to
balance mem use and perf.
Signed-off-by: Mike Christie
---
drivers/vhost/Kconfig | 1 +
drivers/vhost/scsi.c
this patch has stop duplicating the storing of SCSI values
like lun, data dir, data len, cdb, etc on the vhost scsi command and
just pass them to LIO which will store them on the se_cmd.
Signed-off-by: Mike Christie
---
drivers/vhost/scsi.c | 95 +---
1 file
K = 8 bytes per pointer * 2048 * 1 queue
Signed-off-by: Mike Christie
---
drivers/vhost/scsi.c | 24 ++--
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 006ffacf1c56..0cfa56d08450 100644
--- a/drivers/vhost/s
han we can handle. The initiator will then reduce how many
commands it will send us and retry later.
Signed-off-by: Mike Christie
---
drivers/vhost/scsi.c | 28 +---
1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/sc
: Mike Christie
---
drivers/vhost/scsi.c | 14 --
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 0cfa56d08450..776051577a5f 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1648,12 +1648,14 @@ static int
This has us return queue full if we can't allocate a page during the
copy operation so the initiator can retry.
Signed-off-by: Mike Christie
---
drivers/vhost/scsi.c | 15 +--
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/s
t just be where they have the
sense in a second iov but that doesn't seem likely as well.
So to optimize for the common implementation, this has us only
pre-allocate the single iovec. If we do hit the split up response case
this has us allocate the needed iovec when needed.
Signed-off-by: Mik
The following patches were made over Linus's tree and also apply over
the mst vhost branch. They reduce the memory use for vhost-scsi.
For a simple device with 1 queue and 128 cmds we use around 25 MB. These
patches allow us to reduce that to 8.2 MB when supporting up to 128 8 MB
IOs (the current
this patch has stop duplicating the storing of SCSI values
like lun, data dir, data len, cdb, etc on the vhost scsi command and
just pass them to LIO which will store them on the se_cmd.
Signed-off-by: Mike Christie
---
drivers/vhost/scsi.c | 95 +---
1 file
t just be where they have the
sense in a second iov but that doesn't seem likely as well.
So to optimize for the common implementation, this has us only
pre-allocate the single iovec. If we do hit the split up response case
this has us allocate the needed iovec when needed.
Signed-off-by: Mik
: Mike Christie
---
drivers/vhost/scsi.c | 14 --
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index adb3cd47b4e3..99e008219e6c 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1651,12 +1651,14 @@ static int
K = 8 bytes per pointer * 2048 * 1 queue
Signed-off-by: Mike Christie
---
drivers/vhost/scsi.c | 24 ++--
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 718fa4e0b31e..adb3cd47b4e3 100644
--- a/drivers/vhost/s
very fast (8 NVMe drives in a MD RAID0 config or a
memory backed device). As a result this patch makes the dynamic
allocation feature a modparam so userspace can decide how it wants to
balance mem use and perf.
Signed-off-by: Mike Christie
---
drivers/vhost/Kconfig | 1 +
drivers/vhost/scsi.c
han we can handle. The initiator will then reduce how many
commands it will send us and retry later.
Signed-off-by: Mike Christie
---
drivers/vhost/scsi.c | 28 +---
1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/sc
along with the patches that removed the duplicated fields on
the vhost_scsd_cmd allow us to reduce mem use by 1 MB in mid size setups
where we have 16 virtqueues and are doing 1024 cmds per queue.
Signed-off-by: Mike Christie
---
drivers/vhost/scsi.c | 26 +-
1 file c
This has us return queue full if we can't allocate a page during the
copy operation so the initiator can retry.
Signed-off-by: Mike Christie
---
drivers/vhost/scsi.c | 15 +--
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/s
quot;)
Reported-by: Haoran Zhang
Closes:
https://lore.kernel.org/virtualization/e418a5ee-45ca-4d18-9b5d-6f8b6b1ad...@oracle.com/T/#me6c0041ce376677419b9b2563494172a01487ecb
Signed-off-by: Mike Christie
---
drivers/vhost/scsi.c | 20 +++-
1 file changed, 11 insertions(+
quot;)
Reported-by: Haoran Zhang
Closes:
https://lore.kernel.org/virtualization/e418a5ee-45ca-4d18-9b5d-6f8b6b1ad...@oracle.com/T/#me6c0041ce376677419b9b2563494172a01487ecb
Signed-off-by: Mike Christie
Reviewed-by: Stefan Hajnoczi
---
v2
- Drop kfree that's no longer needed.
- Update comment
On 1/29/25 10:36 AM, Stefano Garzarella wrote:
>> diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
>> index 9a4cbdc607fa..6bb64f3be7db 100644
>> --- a/drivers/vhost/scsi.c
>> +++ b/drivers/vhost/scsi.c
>> @@ -1828,14 +1828,19 @@ vhost_scsi_set_endpoint(struct vhost_scsi *vs,
>> }
>>
thor forgot to enable the vq_err call
(vq_err is implemented by pr_debug which defaults to off). So this
patch removes the call since it's expected to hit this path during
device discovery.
Fixes: 09d7583294aa ("vhost/scsi: Use common handling code in request queue
handler")
Signed-o
On 6/11/25 2:50 AM, Stefano Garzarella wrote:
> On Tue, Jun 10, 2025 at 11:30:58AM -0500, michael.chris...@oracle.com wrote:
>> On 6/10/25 9:18 AM, Stefano Garzarella wrote:
>>> On Sat, Jun 07, 2025 at 12:18:15PM -0500, Mike Christie wrote:
>>>> As part of the norm
all and I'm guessing the patch author forgot to enable the vq_err
call (vq_err is implemented by pr_debug which defaults to off). So
this patch removes the call since it's expected to hit this path
during device discovery.
Fixes: 09d7583294aa ("vhost/scsi: Use common handling code in
36 matches
Mail list logo