From: Hanna Reitz <hreitz@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-block@nongnu.org
Cc: John Snow <jsnow@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH] ide: Explicitly poll for BHs on cancel
Date: Wed, 19 Jan 2022 12:29:41 +0100 [thread overview]
Message-ID: <ac3505a8-9073-fd42-dd9c-cae41e730481@redhat.com> (raw)
In-Reply-To: <b09405a0-6968-1fb3-60ce-8d91e64c3673@redhat.com>
On 19.01.22 12:11, Paolo Bonzini wrote:
> On 1/5/22 12:13, Hanna Reitz wrote:
>> - assert(s->bus->dma->aiocb == NULL);
>> +
>> + /*
>> + * Wait for potentially still-scheduled BHs, like
>> ide_trim_bh_cb()
>> + * (blk_drain() will only poll if there are in-flight
>> requests on the
>> + * BlockBackend, which there may not necessarily be, e.g.
>> when the
>> + * guest has issued a zero-length TRIM request)
>> + */
>> + while (s->bus->dma->aiocb) {
>> + bool progress = aio_poll(qemu_get_aio_context(), true);
>> + assert(progress);
>> + }
>
>
> I think the right way to do this is to do blk_inc_in_flight before
> scheduling the bottom half and blk_dec_in_flight in the BH callback.
> See virtio_blk_dma_restart_cb for an example.
Oh, yes, that sounds better. Thanks!
Hanna
prev parent reply other threads:[~2022-01-19 11:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-05 11:13 [PATCH] ide: Explicitly poll for BHs on cancel Hanna Reitz
2022-01-05 13:53 ` Hanna Reitz
2022-01-06 0:11 ` Philippe Mathieu-Daudé
2022-01-07 8:05 ` Mark Cave-Ayland
2022-01-19 11:11 ` Paolo Bonzini
2022-01-19 11:29 ` Hanna Reitz [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=ac3505a8-9073-fd42-dd9c-cae41e730481@redhat.com \
--to=hreitz@redhat.com \
--cc=jsnow@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).