From: Stefan Hajnoczi <stefanha@redhat.com>
To: Ming Lei <ming.lei@canonical.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Fam Zheng <famz@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] linux-aio: fix submit aio as a batch
Date: Wed, 9 Jul 2014 10:29:51 +0200 [thread overview]
Message-ID: <20140709082951.GA5152@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1404834310-12856-1-git-send-email-ming.lei@canonical.com>
[-- Attachment #1: Type: text/plain, Size: 1512 bytes --]
On Tue, Jul 08, 2014 at 11:45:10PM +0800, Ming Lei wrote:
> In the enqueue path, we can't complete request, otherwise
> "Co-routine re-entered recursively" may be caused, so this
> patch fixes the issue with below ideas:
Thi probably happens when the caller is in coroutine context and its
completion function invokes qemu_coroutine_enter() on itself. The
solution is to invoke completions from a BH (other places in the block
layer do this too).
> - for -EAGAIN, retry the submission in an introduced event handler
I agree with Paolo that a BH is appropriate.
> - for part of completion, just update the io queue, since it is
> moving on after all
If we do this then we need to guarantee that io_submit() will be called
at some point soon. Otherwise requests could get stuck if the guest
doesn't submit any more I/O requests to push the queue.
Please split this into separate patches. You're trying to do too much.
Overall, I would prefer it if we avoid the extra complexity of deferring
io_submit() on EAGAIN and partial submission. Do you understand why the
kernel is producing this behavior? Can we set the right capacity in
io_setup() so it doesn't happen?
> + if (enqueue)
> + return ret;
Please set up a git hook to run checkpatch.pl. It will alert you when
you violate QEMU coding style:
http://blog.vmsplice.net/2011/03/how-to-automatically-run-checkpatchpl.html
I already mentioned coding style in previous patches, using a git hook
will avoid it happening again.
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2014-07-09 8:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-08 15:45 [Qemu-devel] [PATCH] linux-aio: fix submit aio as a batch Ming Lei
2014-07-08 17:41 ` Paolo Bonzini
2014-07-09 1:33 ` Ming Lei
2014-07-09 8:29 ` Stefan Hajnoczi [this message]
2014-07-09 12:42 ` Eric Blake
2014-07-11 15:43 ` Ming Lei
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=20140709082951.GA5152@stefanha-thinkpad.redhat.com \
--to=stefanha@redhat.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=ming.lei@canonical.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.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).