qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>,
	Stefan Hajnoczi <stefanha@redhat.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>,
	Kevin Wolf <kwolf@redhat.com>,
	ming.lei@canonical.com,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Dominik Dingel <dingel@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] another locking issue in current dataplane code?
Date: Tue, 08 Jul 2014 21:50:29 +0200	[thread overview]
Message-ID: <53BC4B85.8040107@redhat.com> (raw)
In-Reply-To: <53BC4181.6070604@de.ibm.com>

Il 08/07/2014 21:07, Christian Borntraeger ha scritto:
> On 08/07/14 19:08, Paolo Bonzini wrote:
>> Il 08/07/2014 17:59, Stefan Hajnoczi ha scritto:
>>> I sent Christian an initial patch to fix this but now both threads are
>>> stuck in rfifolock_lock() inside cond wait.  That's very strange and
>>> should never happen.
>>
>> I had this patch pending for 2.2:
>>
>> commit 6c81e31615c3cda5ea981a998ba8b1b8ed17de6f
>> Author: Paolo Bonzini <pbonzini@redhat.com>
>> Date:   Mon Jul 7 10:39:49 2014 +0200
>>
>>     iothread: do not rely on aio_poll(ctx, true) result to end a loop
>>
>>     Currently, whenever aio_poll(ctx, true) has completed all pending
>>     work it returns true *and* the next call to aio_poll(ctx, true)
>>     will not block.
>>
>>     This invariant has its roots in qemu_aio_flush()'s implementation
>>     as "while (qemu_aio_wait()) {}".  However, qemu_aio_flush() does
>>     not exist anymore and bdrv_drain_all() is implemented differently;
>>     and this invariant is complicated to maintain and subtly different
>>     from the return value of GMainLoop's g_main_context_iteration.
>>
>>     All calls to aio_poll(ctx, true) except one are guarded by a
>>     while() loop checking for a request to be incomplete, or a
>>     BlockDriverState to be idle.  Modify that one exception in
>>     iothread.c.
>>
>>     Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>
> The hangs are gone. Looks like 2.1 material now...
>
> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
> Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>

Great, I'll send it out tomorrow morning.

Paolo

  reply	other threads:[~2014-07-08 19:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-07 11:58 [Qemu-devel] another locking issue in current dataplane code? Christian Borntraeger
2014-07-08  7:19 ` Christian Borntraeger
2014-07-08  7:43   ` Ming Lei
2014-07-08  8:38     ` Christian Borntraeger
2014-07-08  9:09     ` Christian Borntraeger
2014-07-08 10:12       ` Christian Borntraeger
2014-07-08 10:37         ` Christian Borntraeger
2014-07-08 11:03           ` Christian Borntraeger
2014-07-08 15:59 ` Stefan Hajnoczi
2014-07-08 17:08   ` Paolo Bonzini
2014-07-08 19:07     ` Christian Borntraeger
2014-07-08 19:50       ` Paolo Bonzini [this message]
2014-07-09  7:56       ` Stefan Hajnoczi

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=53BC4B85.8040107@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=dingel@linux.vnet.ibm.com \
    --cc=kwolf@redhat.com \
    --cc=ming.lei@canonical.com \
    --cc=qemu-devel@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).