qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@suse.de>
To: qemu-devel@nongnu.org, kwolf@redhat.com, armbru@redhat.com,
	eesposit@redhat.com, vsementsov@yandex-team.ru
Subject: Question about QMP and BQL
Date: Fri, 12 May 2023 15:01:43 -0300	[thread overview]
Message-ID: <87h6sh2zug.fsf@suse.de> (raw)

Is there a way to execute a long-standing QMP command outside of the
BQL?

The situation we're seeing is a slow query-block due to a slow system
call (fstat over NFS) causing the main thread to spend too long
holding the global mutex and locking up the vcpu thread when it goes
out of the guest for MMIO.

The call chain for QMP is:

qmp_query_block
bdrv_query_info
bdrv_block_device_info
bdrv_query_image_info
bdrv_do_query_node_info
bdrv_get_allocated_file_size
bdrv_poll_co <- Waiting with qemu_global_mutex locked

[coroutine] bdrv_co_get_allocated_file_size_entry
bdrv_co_get_allocated_file_size
raw_co_get_allocated_file_size
fstat <- SLOW!

The closest I got was moving the coroutine into a separate iothread,
unlocking the global mutex and releasing the bdrv aio_context around
aio_poll. It feels wrong though because we're technically still
operating on the block state but not holding the context.

Is there a more standard way if doing this? Is it possible at all?

Thanks


             reply	other threads:[~2023-05-12 18:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-12 18:01 Fabiano Rosas [this message]
2023-05-15 11:08 ` Question about QMP and BQL Markus Armbruster
2023-05-15 13:18 ` Kevin Wolf
2023-05-16 15:13   ` Fabiano Rosas

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=87h6sh2zug.fsf@suse.de \
    --to=farosas@suse.de \
    --cc=armbru@redhat.com \
    --cc=eesposit@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@yandex-team.ru \
    /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).