From: Juan Quintela <quintela@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: ali saeedi <ali.saeedi56@gmail.com>,
qemu-devel@nongnu.org, pbonzini@gapps.redhat.com,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [Qemu-devel] bitmap
Date: Tue, 23 May 2017 13:24:26 +0200 [thread overview]
Message-ID: <87k25795p1.fsf@secure.mitica> (raw)
In-Reply-To: <20170522154501.GA2925@stefanha-x1.localdomain> (Stefan Hajnoczi's message of "Mon, 22 May 2017 16:45:01 +0100")
Stefan Hajnoczi <stefanha@gmail.com> wrote:
> On Mon, May 22, 2017 at 06:00:12PM +0430, ali saeedi wrote:
>> does this code 'atomic_rcu_read(&migration_bitmap_rcu)->bmap' return bitmap
>> of dirty blocks or bitmap of pages?
>
> This code changed recently. Please refer to qemu.git/master when asking
> questions on qemu-devel.
>
> I think you're asking about what is now RAMBlock->bmap. This bitmap
> describes pages (each page is TARGET_PAGE_SIZE bytes).
>
> This comment looks outdated, I don't think it returns a byte offset:
>
> /**
> * migration_bitmap_find_dirty: find the next dirty page from start
> *
> * Called with rcu_read_lock() to protect migration_bitmap
> *
> * Returns the byte offset within memory region of the start of a dirty page
> *
> * @rs: current RAM state
> * @rb: RAMBlock where to search for dirty pages
> * @start: page where we start the search
> */
> static inline
> unsigned long migration_bitmap_find_dirty(RAMState *rs, RAMBlock *rb,
> unsigned long start)
>
> Evidence:
>
> static bool find_dirty_block(RAMState *rs, PageSearchStatus *pss, bool *again)
> {
> pss->page = migration_bitmap_find_dirty(rs, pss->block, pss->page);
> ...
> if ((pss->page << TARGET_PAGE_BITS) >= pss->block->used_length) {
>
> Stefan
Oops, thanks you are right.
We used to have a global dirty bitmap. As far as I know, it has always
worked on pages. TARGET_PAGE_SIZE to be exact. Since 2.10 open out, we
moved to a bitmap by RAMBlock. It used to return an absolute page
number, now it returns a page number relative to the start of the block.
Later, Juan.
prev parent reply other threads:[~2017-05-23 11:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-22 13:30 [Qemu-devel] bitmap ali saeedi
2017-05-22 15:45 ` Stefan Hajnoczi
2017-05-23 11:24 ` Juan Quintela [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=87k25795p1.fsf@secure.mitica \
--to=quintela@redhat.com \
--cc=ali.saeedi56@gmail.com \
--cc=dgilbert@redhat.com \
--cc=pbonzini@gapps.redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.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).