OSDN Git Service

exec: use memory_region_get_dirty_log_mask to optimize dirty tracking
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 23 Mar 2015 10:45:53 +0000 (11:45 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 5 Jun 2015 15:09:59 +0000 (17:09 +0200)
commit845b6214a309fa58a4405050bf8313e19fde5c91
treeb1da19f1dd2ee0515bf637c28e727dceb86d84af
parent49dfcec40349245ad365964468b67e132c3cedc7
exec: use memory_region_get_dirty_log_mask to optimize dirty tracking

The memory API can now return the exact set of bitmaps that have to
be tracked.  Use it instead of the in_migration variable.

In the next patches, we will also use it to set only DIRTY_MEMORY_VGA
or DIRTY_MEMORY_MIGRATION if necessary.  This can make a difference
for dataplane, especially after the dirty bitmap is changed to use
more expensive atomic operations.

Of some interest is the change to stl_phys_notdirty.  When migration
was introduced, stl_phys_notdirty was changed to effectively behave
as stl_phys during migration.  In fact, if one looks at the function as it
was in the beginning (commit 8df1cd0, physical memory access functions,
2005-01-28), at the time the dirty bitmap was the equivalent of
DIRTY_MEMORY_CODE nowadays; hence, the function simply should not touch
the dirty code bits.  This patch changes it to do the intended thing.

Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
exec.c