OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
To: no-reply@sashiko.virtuozzo.com, andrey.zhadchenko@virtuozzo.com
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.2 v2 4/4] drivers/vhost/blk: add the VHOST_BLK_RESUBMIT ioctl
Date: Tue, 1 Dec 2026 09:23:52 +0100	[thread overview]
Message-ID: <1274b0f7-1200-41dd-bc2d-7eed0c629beb@virtuozzo.com> (raw)
In-Reply-To: <010701a22f2f84cf-5824dcfc-f50b-4039-8ff3-fb6c90840a9a-000000@eu-central-1.amazonses.com>

>> +
>> +/*
>> + * Resubmit requests by vq and head, as if they were just taken from the avail
>> + * ring. Only heads read with VHOST_BLK_GET_HELD_REQS after the last stop may be
>> + * passed: the kernel does not track them. A head passed again after its request
>> + * completed, still owned by the guest, or reused by the guest since the backend
>> + * was set, is completed twice, or fails with -EBUSY while still in flight.
>> + * error and type are ignored, reserved must be 0. On error, nr is set to the
>> + * index of the entry that failed; the entries before it were resubmitted.
>> + * Fails with -ENODEV until the backend is set.
>> + */
>> +#define VHOST_BLK_RESUBMIT		_IOWR(VHOST_VIRTIO, 0xFA, \
>> +					      struct vhost_blk_held_reqs)
>>   #endif
> [Severity: Low]
> As reported by Konstantin Khorenko on v1 [1], this comment does not say
> what userspace should do with the entry that failed. Which errors are
> transient, so the same entry can be retried? Which are permanent, so it
> should be skipped?
>
> vhost_blk_resubmit() stops at the first non-zero return. That can be
> -ENOMEM or -EAGAIN from the descriptor parsing and request submission,
> -EINTR from the loop, or -EFAULT, -EINVAL, -EBUSY or -ENODEV from
> vhost_blk_resubmit_one(). Without a documented rule, one bad entry can
> block every held request after it, and userspace cannot tell whether to
> retry, skip or give up.
>
> [1] https://lore.kernel.org/r/179578030084.10258.14556640974201502480.b4-review@b4
>
Agreed. v4 documents it: retry the same entry on -ENOMEM, stop on
-ENODEV or -EINTR, otherwise go on from nr + 1. -EAGAIN cannot come
back here: the backend is checked under vq->mutex, and there is no
IOTLB.
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

      reply	other threads:[~2026-12-01  8:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 16:25 [Devel] [PATCH hci-8.2 v2 0/4] drivers/vhost/blk: hold requests failed with ENOSPC until QEMU resubmits them Alexander Ivanov
2026-11-30 16:25 ` [Devel] [PATCH hci-8.2 v2 1/4] drivers/vhost: split the descriptor chain walk out of vhost_get_vq_desc() Alexander Ivanov
2026-12-01  1:11   ` no-reply
2026-11-30 16:25 ` [Devel] [PATCH hci-8.2 v2 2/4] drivers/vhost/blk: split request parsing out of the guest kick handler Alexander Ivanov
2026-12-01  1:11   ` no-reply
2026-11-30 16:25 ` [Devel] [PATCH hci-8.2 v2 3/4] drivers/vhost/blk: hold requests failed with ENOSPC Alexander Ivanov
2026-12-01  1:16   ` no-reply
2026-12-01  8:16     ` Alexander Ivanov
2026-11-30 16:25 ` [Devel] [PATCH hci-8.2 v2 4/4] drivers/vhost/blk: add the VHOST_BLK_RESUBMIT ioctl Alexander Ivanov
2026-12-01  1:19   ` no-reply
2026-12-01  8:23     ` Alexander Ivanov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1274b0f7-1200-41dd-bc2d-7eed0c629beb@virtuozzo.com \
    --to=alexander.ivanov@virtuozzo.com \
    --cc=andrey.zhadchenko@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=no-reply@sashiko.virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox