* [Qemu-devel] bitmap @ 2017-05-22 13:30 ali saeedi 2017-05-22 15:45 ` Stefan Hajnoczi 0 siblings, 1 reply; 3+ messages in thread From: ali saeedi @ 2017-05-22 13:30 UTC (permalink / raw) To: qemu-devel Hi does this code 'atomic_rcu_read(&migration_bitmap_rcu)->bmap' return bitmap of dirty blocks or bitmap of pages? thanks a lot ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] bitmap 2017-05-22 13:30 [Qemu-devel] bitmap ali saeedi @ 2017-05-22 15:45 ` Stefan Hajnoczi 2017-05-23 11:24 ` Juan Quintela 0 siblings, 1 reply; 3+ messages in thread From: Stefan Hajnoczi @ 2017-05-22 15:45 UTC (permalink / raw) To: ali saeedi; +Cc: qemu-devel, pbonzini, Juan Quintela, Dr. David Alan Gilbert [-- Attachment #1: Type: text/plain, Size: 1207 bytes --] 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 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 455 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] bitmap 2017-05-22 15:45 ` Stefan Hajnoczi @ 2017-05-23 11:24 ` Juan Quintela 0 siblings, 0 replies; 3+ messages in thread From: Juan Quintela @ 2017-05-23 11:24 UTC (permalink / raw) To: Stefan Hajnoczi; +Cc: ali saeedi, qemu-devel, pbonzini, Dr. David Alan Gilbert 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. ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-05-23 11:24 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 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).