qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>,
	QEMU Devel Mailing List <qemu-devel@nongnu.org>
Subject: Re: Question on memory commit during MR finalize()
Date: Mon, 20 Apr 2020 23:44:11 +0200	[thread overview]
Message-ID: <fe73a74b-2324-68a5-a37f-530a6bb03ebc@redhat.com> (raw)
In-Reply-To: <20200420210049.GA420399@xz-x1>

On 20/04/20 23:00, Peter Xu wrote:
> 
> I'm still uncertain how the dirty ring branch can easily trigger this, however
> the backtrace looks really odd to me in that we're going to do memory commit
> and even sending KVM ioctls during finalize(), especially in the RCU thread...
> I never expected that.

Short answer: it is really hard to not trigger finalize() from an RCU
callback, and it's the reason why the RCU thread takes the big QEMU lock.

However, instead of memory_region_transaction_commit,
memory_region_finalize probably should do something like

    --memory_region_transaction_depth;
    assert (memory_region_transaction_depth ||
	    (!memory_region_update_pending &&
             !ioeventfd_update_pending));

Paolo



  reply	other threads:[~2020-04-20 21:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-20 21:00 Question on memory commit during MR finalize() Peter Xu
2020-04-20 21:44 ` Paolo Bonzini [this message]
2020-04-20 23:31   ` Peter Xu
2020-04-21  9:43     ` Paolo Bonzini
2020-04-21 10:43       ` Peter Xu
2021-07-15 14:27         ` Thanos Makatos
2021-07-15 18:35           ` Peter Xu
2021-07-16 11:42             ` Thanos Makatos
2021-07-16 14:18               ` Peter Xu
2021-07-19 14:38                 ` Thanos Makatos
2021-07-19 15:56                   ` Peter Xu
2021-07-19 18:02                     ` Thanos Makatos
2021-07-19 19:05                       ` Thanos Makatos
2021-07-19 19:59                         ` Peter Xu
2021-07-19 20:58                           ` John Johnson
2021-07-20  1:22                             ` Peter Xu

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=fe73a74b-2324-68a5-a37f-530a6bb03ebc@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=armbru@redhat.com \
    --cc=peterx@redhat.com \
    --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).