From: Max Reitz <mreitz@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, dplotnikov@virtuozzo.com,
vsementsov@virtuozzo.com, den@virtuozzo.com
Subject: Re: [Qemu-devel] [PATCH v2 3/3] block-backend: Queue requests while drained
Date: Wed, 7 Aug 2019 23:38:20 +0200 [thread overview]
Message-ID: <ac80ef55-981f-375c-d505-44ae82f41417@redhat.com> (raw)
In-Reply-To: <20190807144628.4988-4-kwolf@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 1772 bytes --]
On 07.08.19 16:46, Kevin Wolf wrote:
> This fixes devices like IDE that can still start new requests from I/O
> handlers in the CPU thread while the block backend is drained.
>
> The basic assumption is that in a drain section, no new requests should
> be allowed through a BlockBackend (blk_drained_begin/end don't exist,
> we get drain sections only on the node level). However, there are two
> special cases where requests should not be queued:
>
> 1. Block jobs: We already make sure that block jobs are paused in a
> drain section, so they won't start new requests. However, if the
> drain_begin is called on the job's BlockBackend first, it can happen
> that we deadlock because the job stays busy until it reaches a pause
> point - which it can't if its requests aren't processed any more.
>
> The proper solution here would be to make all requests through the
> job's filter node instead of using a BlockBackend. For now, just
> disabling request queuing on the job BlockBackend is simpler.
>
> 2. In test cases where making requests through bdrv_* would be
> cumbersome because we'd need a BdrvChild. As we already got the
> functionality to disable request queuing from 1., use it in tests,
> too, for convenience.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> include/sysemu/block-backend.h | 1 +
> block/backup.c | 1 +
> block/block-backend.c | 53 ++++++++++++++++++++++++++++++++--
> block/commit.c | 2 ++
> block/mirror.c | 1 +
> blockjob.c | 3 ++
> tests/test-bdrv-drain.c | 1 +
> 7 files changed, 59 insertions(+), 3 deletions(-)
Reviewed-by: Max Reitz <mreitz@redhat.com>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-08-07 21:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-07 14:46 [Qemu-devel] [PATCH v2 0/3] block-backend: Queue requests while drained Kevin Wolf
2019-08-07 14:46 ` [Qemu-devel] [PATCH v2 1/3] block: Remove blk_pread_unthrottled() Kevin Wolf
2019-08-07 14:46 ` [Qemu-devel] [PATCH v2 2/3] mirror: Keep mirror_top_bs drained after dropping permissions Kevin Wolf
2019-08-07 21:26 ` Max Reitz
2019-08-07 14:46 ` [Qemu-devel] [PATCH v2 3/3] block-backend: Queue requests while drained Kevin Wolf
2019-08-07 21:38 ` Max Reitz [this message]
2019-08-07 15:10 ` [Qemu-devel] [PATCH v2 0/3] " no-reply
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=ac80ef55-981f-375c-d505-44ae82f41417@redhat.com \
--to=mreitz@redhat.com \
--cc=den@virtuozzo.com \
--cc=dplotnikov@virtuozzo.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@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;
as well as URLs for NNTP newsgroup(s).