From: Paolo Bonzini <pbonzini@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>,
Jitendra Kolhe <jitendra.kolhe@hpe.com>
Cc: JBottomley@Odin.com, ehabkost@redhat.com,
crosthwaite.peter@gmail.com, simhan@hpe.com, armbru@redhat.com,
quintela@redhat.com, qemu-devel@nongnu.org,
lcapitulino@redhat.com, borntraeger@de.ibm.com,
mohan_parthasarathy@hpe.com, stefanha@redhat.com,
amit.shah@redhat.com, den@openvz.org, dgilbert@redhat.com,
rth@twiddle.net
Subject: Re: [Qemu-devel] [PATCH v2] migration: skip sending ram pages released by virtio-balloon driver.
Date: Tue, 29 Mar 2016 12:05:57 +0200 [thread overview]
Message-ID: <56FA5385.1030608@redhat.com> (raw)
In-Reply-To: <20160328094945-mutt-send-email-mst@redhat.com>
On 28/03/2016 08:59, Michael S. Tsirkin wrote:
>> > + qemu_mutex_lock_balloon_bitmap();
>> > for (;;) {
>> > size_t offset = 0;
>> > uint32_t pfn;
>> > elem = virtqueue_pop(vq, sizeof(VirtQueueElement));
>> > if (!elem) {
>> > + qemu_mutex_unlock_balloon_bitmap();
>> > return;
>> > }
>> >
>> > @@ -242,6 +245,7 @@ static void virtio_balloon_handle_output(VirtIODevice *vdev, VirtQueue *vq)
>> > addr = section.offset_within_region;
>> > balloon_page(memory_region_get_ram_ptr(section.mr) + addr,
>> > !!(vq == s->dvq));
>> > + qemu_balloon_bitmap_update(addr, !!(vq == s->dvq));
>> > memory_region_unref(section.mr);
>> > }
>> >
> So the assumption here is that offset_within_region equals
> ram ptr if region is get_system_memory.
>
> And I'm not sure that's always right.
>
> Paolo?
Indeed. It is correct for the main system RAM, but hot-plugged RAM
would also have a zero-based section.offset_within_region. You need to
add memory_region_get_ram_addr(section.mr), just like the call to
balloon_page adds memory_region_get_ram_ptr(section.mr).
Paolo
next prev parent reply other threads:[~2016-03-29 10:06 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-28 4:16 [Qemu-devel] [PATCH v2] migration: skip sending ram pages released by virtio-balloon driver Jitendra Kolhe
2016-03-28 6:59 ` Michael S. Tsirkin
2016-03-29 10:05 ` Paolo Bonzini [this message]
2016-03-29 10:47 ` Jitendra Kolhe
2016-03-29 10:48 ` Paolo Bonzini
2016-04-01 11:19 ` Jitendra Kolhe
2016-03-28 10:36 ` Denis V. Lunev
2016-03-29 11:34 ` Jitendra Kolhe
2016-03-28 14:11 ` Eric Blake
2016-03-29 12:13 ` Jitendra Kolhe
2016-03-29 12:28 ` Michael S. Tsirkin
2016-04-01 11:08 ` Jitendra Kolhe
2016-04-10 16:59 ` Michael S. Tsirkin
2016-04-13 10:54 ` Jitendra Kolhe
2016-04-13 11:10 ` Michael S. Tsirkin
2016-04-13 11:15 ` Dr. David Alan Gilbert
2016-04-13 11:36 ` Michael S. Tsirkin
2016-04-29 10:31 ` Jitendra Kolhe
2016-03-31 16:39 ` Dr. David Alan Gilbert
2016-04-05 10:04 ` Jitendra Kolhe
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=56FA5385.1030608@redhat.com \
--to=pbonzini@redhat.com \
--cc=JBottomley@Odin.com \
--cc=amit.shah@redhat.com \
--cc=armbru@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=crosthwaite.peter@gmail.com \
--cc=den@openvz.org \
--cc=dgilbert@redhat.com \
--cc=ehabkost@redhat.com \
--cc=jitendra.kolhe@hpe.com \
--cc=lcapitulino@redhat.com \
--cc=mohan_parthasarathy@hpe.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=rth@twiddle.net \
--cc=simhan@hpe.com \
--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 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.