From: Avi Kivity <avi@redhat.com>
To: OHMURA Kei <ohmura.kei@lab.ntt.co.jp>
Cc: mtosatti@redhat.com, qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: [Qemu-devel] Re: [PATCH] qemu-kvm: Speed up of the dirty-bitmap-traveling
Date: Wed, 10 Feb 2010 12:24:30 +0200 [thread overview]
Message-ID: <4B72895E.7050006@redhat.com> (raw)
In-Reply-To: <4B7282A5.7090500@lab.ntt.co.jp>
On 02/10/2010 11:55 AM, OHMURA Kei wrote:
>
>> Instead of using a nested loop if bitmap_ul[i] != 0, it is possible to
>> use just a single loop (while (c> 0)), and process a long's worth of data.
>>
>> The only trickery is with big endian hosts, where the conversion from
>> bit number to page number is a bit complicated.
>>
> To convert the bitmap from big endian to little endian, le_bswap macro in
> bswap.h seems useful, which is now undefined. What do you think about this
> approach?
>
> This is an example bitmap-traveling code using le_bswap:
> /*
> * bitmap-traveling is faster than memory-traveling (for addr...)
> * especially when most of the memory is not dirty.
> */
> for (i = 0; i < len; i++) {
> if (bitmap_ul[i] != 0) {
> c = le_bswap(bitmap_ul[i], HOST_LONG_BITS);
> while (c > 0) {
> j = ffsl(c) - 1;
> c &= ~(1ul << j);
> page_number = i * HOST_LONG_BITS + j;
> addr1 = page_number * TARGET_PAGE_SIZE;
> addr = offset + addr1;
> ram_addr = cpu_get_physical_page_desc(addr);
> cpu_physical_memory_set_dirty(ram_addr);
> }
> }
> }
>
Yes, that solves the problem very neatly.
--
error compiling committee.c: too many arguments to function
prev parent reply other threads:[~2010-02-10 10:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-05 10:18 [Qemu-devel] [PATCH] qemu-kvm: Speed up of the dirty-bitmap-traveling OHMURA Kei
2010-02-05 12:04 ` [Qemu-devel] " Jan Kiszka
2010-02-08 6:14 ` OHMURA Kei
2010-02-08 11:23 ` OHMURA Kei
2010-02-08 11:44 ` Jan Kiszka
2010-02-09 9:55 ` OHMURA Kei
2010-02-08 12:40 ` Avi Kivity
2010-02-09 9:54 ` OHMURA Kei
2010-02-09 10:26 ` Avi Kivity
2010-02-10 9:55 ` OHMURA Kei
2010-02-10 10:24 ` Avi Kivity [this message]
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=4B72895E.7050006@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=ohmura.kei@lab.ntt.co.jp \
--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).