qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, fam@euphon.net,
	mst@redhat.com, kwolf@redhat.com, qemu-stable@nongnu.org
Subject: Re: [RFC] hw/scsi: avoid deadlock upon TMF request canceling with VirtIO
Date: Fri, 17 Oct 2025 10:20:41 +0200	[thread overview]
Message-ID: <07150a24-d155-49c9-958c-361ea7ae6ced@proxmox.com> (raw)
In-Reply-To: <20251016175857.GA1174862@fedora>

Hi Stefan,

Am 16.10.25 um 8:25 PM schrieb Stefan Hajnoczi:
> On Wed, Oct 15, 2025 at 03:43:50PM +0200, Fiona Ebner wrote:
>> RFC, because it's a naive approach, maybe somebody has a better idea?
> 
> Another approach is the one taken in scsi_device_for_each_req_async_bh()
> where requests from this AioContext are collected into a GList and then
> processed after releasing s->requests_lock. It's safe because the
> function runs in the request's AioContext and we know nothing else can
> modify the request while we are running. The same constraint applies in
> this case too.
> 
> That solution is more localized because various function prototypes
> don't need to be extended with holds_requests_lock. Either it can be
> open coded inside virtio_scsi_do_tmf_aio_context() or you could extract
> a helper function from scsi_device_for_each_req_async_bh() in scsi-bus.c
> and call the new helper from virtio_scsi_do_tmf_aio_context().
> 
> I slightly prefer a localized fix so that other parts of the codebase
> don't need to worry about whether or not requests_lock is held. Do you
> want to try implementing that?
thank you for the suggestion and pointers! I also feel like a localized
solution would be nicer. I'll try this approach.

Kind Regards,
Fiona



      reply	other threads:[~2025-10-17  8:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-15 13:43 [RFC] hw/scsi: avoid deadlock upon TMF request canceling with VirtIO Fiona Ebner
2025-10-16 17:58 ` Stefan Hajnoczi
2025-10-17  8:20   ` Fiona Ebner [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=07150a24-d155-49c9-958c-361ea7ae6ced@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=fam@euphon.net \
    --cc=kwolf@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=stefanha@redhat.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;
as well as URLs for NNTP newsgroup(s).