OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: no-reply@sashiko.virtuozzo.com
To: Alexander Ivanov <alexander.ivanov@virtuozzo.com>,
	andrey.zhadchenko@virtuozzo.com
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 v2 1/2] drivers/vhost/blk: fix a flush hang on requests completed after worker kill
Date: Fri, 13 Nov 2026 08:34:26 +0000	[thread overview]
Message-ID: <010701a1d40b356a-a73e2dd0-93d4-4d82-8c66-43de8edfb637-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261113082744.2334476-2-alexander.ivanov@virtuozzo.com>

> When the owner is killed, vhost_worker_killed() detaches the worker
> from the virtqueues and runs only the work already queued. A request
> that completes after that is added to blk_vq->llhead, but
> vhost_vq_work_queue() returns false and queues nothing, so the request
> is never forgotten. req_inflight[] stays elevated and vhost_blk_flush()
> hangs uninterruptibly in release when the fd is closed. A request in
> flight at the kill is enough.
> 
> Release such requests from a work item when the worker cannot be
> queued, as vhost-scsi does in vhost_scsi_drop_cmds(). The bio
> completion may run in interrupt context, where forget_request() and
> the kvfree() of the request buffers are not allowed. The guest is not
> answered, its memory is no longer reachable.
> 
> Once the completion publishes the request, the request can be
> forgotten and vhost_blk_flush() can return while the completion is
> still queueing work into blk, which release then frees. Queue under
> rcu_read_lock() and wait for it with synchronize_rcu() in
> vhost_blk_drop_backend(), then flush the drop work before freeing the
> requests. Flushing there rather than in release also keeps a stale
> drop work from releasing requests of the next owner after
> VHOST_RESET_OWNER.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-141684
> 
> Fixes: 1629db092dd7 ("drivers/vhost: vhost-blk accelerator for virtio-blk guests")
> Feature: vhost-blk: in-kernel accelerator for virtio-blk guests
> Signed-off-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261113082744.2334476-1-alexander.ivanov@virtuozzo.com?part=1


_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  reply	other threads:[~2026-11-13  8:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13  8:27 [Devel] [PATCH hci-8.1 v2 0/2] drivers/vhost/blk: support VIRTIO_BLK_F_WRITE_ZEROES Alexander Ivanov
2026-11-13  8:27 ` [Devel] [PATCH hci-8.1 v2 1/2] drivers/vhost/blk: fix a flush hang on requests completed after worker kill Alexander Ivanov
2026-11-13  8:34   ` no-reply [this message]
2026-11-13 19:55   ` Konstantin Khorenko
2026-11-13  8:27 ` [Devel] [PATCH hci-8.1 v2 2/2] drivers/vhost/blk: support VIRTIO_BLK_F_WRITE_ZEROES Alexander Ivanov
2026-11-13  8:37   ` no-reply
2026-11-13 19:55   ` Konstantin Khorenko
2026-11-13 19:55 ` [Devel] [PATCH hci-8.1 v2 0/2] " Konstantin Khorenko

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=010701a1d40b356a-a73e2dd0-93d4-4d82-8c66-43de8edfb637-000000@eu-central-1.amazonses.com \
    --to=no-reply@sashiko.virtuozzo.com \
    --cc=alexander.ivanov@virtuozzo.com \
    --cc=andrey.zhadchenko@virtuozzo.com \
    --cc=devel@openvz.org \
    /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