From: Wen Congyang <wency@cn.fujitsu.com>
To: "Denis V. Lunev" <den@openvz.org>
Cc: Igor Redko <redkoi@virtuozzo.com>,
Juan Quintela <quintela@redhat.com>,
qemu-devel@nongnu.org, Anna Melekhova <annam@virtuozzo.com>,
Amit Shah <amit.shah@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 0/2] migration: fix deadlock
Date: Fri, 25 Sep 2015 17:46:35 +0800 [thread overview]
Message-ID: <560517FB.9080909@cn.fujitsu.com> (raw)
In-Reply-To: <1443172180-1005-1-git-send-email-den@openvz.org>
On 09/25/2015 05:09 PM, Denis V. Lunev wrote:
> Release qemu global mutex before call synchronize_rcu().
> synchronize_rcu() waiting for all readers to finish their critical
> sections. There is at least one critical section in which we try
> to get QGM (critical section is in address_space_rw() and
> prepare_mmio_access() is trying to aquire QGM).
>
> Both functions (migration_end() and migration_bitmap_extend())
> are called from main thread which is holding QGM.
>
> Thus there is a race condition that ends up with deadlock:
> main thread working thread
> Lock QGA |
> | Call KVM_EXIT_IO handler
> | |
> | Open rcu reader's critical section
> Migration cleanup bh |
> | |
> synchronize_rcu() is |
> waiting for readers |
> | prepare_mmio_access() is waiting for QGM
> \ /
> deadlock
>
> Patches here are quick and dirty, compile-tested only to validate the
> architectual approach.
>
> Igor, Anna, can you pls start your tests with these patches instead of your
> original one. Thank you.
Can you give me the backtrace of the working thread?
I think it is very bad to wait some lock in rcu reader's cirtical section.
To Paolo:
Do we allow this in rcu critical section?
Thanks
Wen Congyang
>
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> CC: Igor Redko <redkoi@virtuozzo.com>
> CC: Anna Melekhova <annam@virtuozzo.com>
> CC: Juan Quintela <quintela@redhat.com>
> CC: Amit Shah <amit.shah@redhat.com>
>
> Denis V. Lunev (2):
> migration: bitmap_set is unnecessary as bitmap_new uses g_try_malloc0
> migration: fix deadlock
>
> migration/ram.c | 45 ++++++++++++++++++++++++++++-----------------
> 1 file changed, 28 insertions(+), 17 deletions(-)
>
next prev parent reply other threads:[~2015-09-25 9:55 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-24 12:53 [Qemu-devel] [PATCH 1/1] migration: fix deadlock Denis V. Lunev
2015-09-25 1:21 ` Wen Congyang
2015-09-25 8:03 ` Denis V. Lunev
2015-09-25 8:23 ` Wen Congyang
2015-09-25 9:09 ` [Qemu-devel] [PATCH v2 0/2] " Denis V. Lunev
2015-09-25 9:09 ` [Qemu-devel] [PATCH 1/2] migration: bitmap_set is unnecessary as bitmap_new uses g_try_malloc0 Denis V. Lunev
2015-09-25 9:24 ` Wen Congyang
2015-09-25 9:31 ` Denis V. Lunev
2015-09-25 9:37 ` Wen Congyang
2015-09-25 10:05 ` Denis V. Lunev
2015-09-25 9:09 ` [Qemu-devel] [PATCH 2/2] migration: fix deadlock Denis V. Lunev
2015-09-25 9:35 ` Wen Congyang
2015-09-25 9:46 ` Wen Congyang [this message]
2015-09-28 10:55 ` [Qemu-devel] [PATCH v2 0/2] " Igor Redko
2015-09-28 15:12 ` Igor Redko
2015-09-29 8:47 ` Dr. David Alan Gilbert
2015-09-30 14:28 ` Igor Redko
2015-09-29 15:32 ` [Qemu-devel] [PATCH 1/1] " Igor Redko
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=560517FB.9080909@cn.fujitsu.com \
--to=wency@cn.fujitsu.com \
--cc=amit.shah@redhat.com \
--cc=annam@virtuozzo.com \
--cc=den@openvz.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=redkoi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.