diff mbox series

[1/3] migration/ram.c: start of migration_bitmap_sync_range is always 0

Message ID 20190430034412.12935-2-richardw.yang@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series Cleanup migration/ram.c | expand

Commit Message

Wei Yang April 30, 2019, 3:44 a.m. UTC
We can eliminate to pass 0.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
---
 migration/ram.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Dr. David Alan Gilbert May 14, 2019, 2:15 p.m. UTC | #1
* Wei Yang (richardw.yang@linux.intel.com) wrote:
> We can eliminate to pass 0.
> 
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  migration/ram.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/migration/ram.c b/migration/ram.c
> index 35bd6213e9..9948b2d021 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -1643,10 +1643,10 @@ static inline bool migration_bitmap_clear_dirty(RAMState *rs,
>  }
>  
>  static void migration_bitmap_sync_range(RAMState *rs, RAMBlock *rb,
> -                                        ram_addr_t start, ram_addr_t length)
> +                                        ram_addr_t length)
>  {
>      rs->migration_dirty_pages +=
> -        cpu_physical_memory_sync_dirty_bitmap(rb, start, length,
> +        cpu_physical_memory_sync_dirty_bitmap(rb, 0, length,
>                                                &rs->num_dirty_pages_period);
>  }
>  
> @@ -1735,7 +1735,7 @@ static void migration_bitmap_sync(RAMState *rs)
>      qemu_mutex_lock(&rs->bitmap_mutex);
>      rcu_read_lock();
>      RAMBLOCK_FOREACH_NOT_IGNORED(block) {
> -        migration_bitmap_sync_range(rs, block, 0, block->used_length);
> +        migration_bitmap_sync_range(rs, block, block->used_length);
>      }
>      ram_counters.remaining = ram_bytes_remaining();
>      rcu_read_unlock();
> @@ -4156,7 +4156,7 @@ static void colo_flush_ram_cache(void)
>      memory_global_dirty_log_sync();
>      rcu_read_lock();
>      RAMBLOCK_FOREACH_NOT_IGNORED(block) {
> -        migration_bitmap_sync_range(ram_state, block, 0, block->used_length);
> +        migration_bitmap_sync_range(ram_state, block, block->used_length);
>      }
>      rcu_read_unlock();
>  
> -- 
> 2.19.1
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
Dr. David Alan Gilbert May 14, 2019, 2:27 p.m. UTC | #2
* Wei Yang (richardw.yang@linux.intel.com) wrote:
> We can eliminate to pass 0.
> 
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>

I'm going to queue just 1/3for the current pull.

Dave

> ---
>  migration/ram.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/migration/ram.c b/migration/ram.c
> index 35bd6213e9..9948b2d021 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -1643,10 +1643,10 @@ static inline bool migration_bitmap_clear_dirty(RAMState *rs,
>  }
>  
>  static void migration_bitmap_sync_range(RAMState *rs, RAMBlock *rb,
> -                                        ram_addr_t start, ram_addr_t length)
> +                                        ram_addr_t length)
>  {
>      rs->migration_dirty_pages +=
> -        cpu_physical_memory_sync_dirty_bitmap(rb, start, length,
> +        cpu_physical_memory_sync_dirty_bitmap(rb, 0, length,
>                                                &rs->num_dirty_pages_period);
>  }
>  
> @@ -1735,7 +1735,7 @@ static void migration_bitmap_sync(RAMState *rs)
>      qemu_mutex_lock(&rs->bitmap_mutex);
>      rcu_read_lock();
>      RAMBLOCK_FOREACH_NOT_IGNORED(block) {
> -        migration_bitmap_sync_range(rs, block, 0, block->used_length);
> +        migration_bitmap_sync_range(rs, block, block->used_length);
>      }
>      ram_counters.remaining = ram_bytes_remaining();
>      rcu_read_unlock();
> @@ -4156,7 +4156,7 @@ static void colo_flush_ram_cache(void)
>      memory_global_dirty_log_sync();
>      rcu_read_lock();
>      RAMBLOCK_FOREACH_NOT_IGNORED(block) {
> -        migration_bitmap_sync_range(ram_state, block, 0, block->used_length);
> +        migration_bitmap_sync_range(ram_state, block, block->used_length);
>      }
>      rcu_read_unlock();
>  
> -- 
> 2.19.1
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
Wei Yang May 15, 2019, 6:41 a.m. UTC | #3
On Tue, May 14, 2019 at 03:27:02PM +0100, Dr. David Alan Gilbert wrote:
>* Wei Yang (richardw.yang@linux.intel.com) wrote:
>> We can eliminate to pass 0.
>> 
>> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
>
>I'm going to queue just 1/3for the current pull.

In the pull request, I didn't see Patch[3]. Do I misunderstand this?

>
>Dave
>
Dr. David Alan Gilbert May 15, 2019, 8:04 a.m. UTC | #4
* Wei Yang (richardw.yang@linux.intel.com) wrote:
> On Tue, May 14, 2019 at 03:27:02PM +0100, Dr. David Alan Gilbert wrote:
> >* Wei Yang (richardw.yang@linux.intel.com) wrote:
> >> We can eliminate to pass 0.
> >> 
> >> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
> >
> >I'm going to queue just 1/3for the current pull.
> 
> In the pull request, I didn't see Patch[3]. Do I misunderstand this?

Yes I meant only '[Patch 1/3]'.

Dave

> >
> >Dave
> >
> 
> -- 
> Wei Yang
> Help you, Help me
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
Wei Yang May 15, 2019, 8:54 a.m. UTC | #5
On Wed, May 15, 2019 at 09:04:51AM +0100, Dr. David Alan Gilbert wrote:
>* Wei Yang (richardw.yang@linux.intel.com) wrote:
>> On Tue, May 14, 2019 at 03:27:02PM +0100, Dr. David Alan Gilbert wrote:
>> >* Wei Yang (richardw.yang@linux.intel.com) wrote:
>> >> We can eliminate to pass 0.
>> >> 
>> >> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
>> >
>> >I'm going to queue just 1/3for the current pull.
>> 
>> In the pull request, I didn't see Patch[3]. Do I misunderstand this?
>
>Yes I meant only '[Patch 1/3]'.

Ah, thanks :-)

>
>Dave
>
>> >
>> >Dave
>> >
>> 
>> -- 
>> Wei Yang
>> Help you, Help me
>--
>Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
diff mbox series

Patch

diff --git a/migration/ram.c b/migration/ram.c
index 35bd6213e9..9948b2d021 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1643,10 +1643,10 @@  static inline bool migration_bitmap_clear_dirty(RAMState *rs,
 }
 
 static void migration_bitmap_sync_range(RAMState *rs, RAMBlock *rb,
-                                        ram_addr_t start, ram_addr_t length)
+                                        ram_addr_t length)
 {
     rs->migration_dirty_pages +=
-        cpu_physical_memory_sync_dirty_bitmap(rb, start, length,
+        cpu_physical_memory_sync_dirty_bitmap(rb, 0, length,
                                               &rs->num_dirty_pages_period);
 }
 
@@ -1735,7 +1735,7 @@  static void migration_bitmap_sync(RAMState *rs)
     qemu_mutex_lock(&rs->bitmap_mutex);
     rcu_read_lock();
     RAMBLOCK_FOREACH_NOT_IGNORED(block) {
-        migration_bitmap_sync_range(rs, block, 0, block->used_length);
+        migration_bitmap_sync_range(rs, block, block->used_length);
     }
     ram_counters.remaining = ram_bytes_remaining();
     rcu_read_unlock();
@@ -4156,7 +4156,7 @@  static void colo_flush_ram_cache(void)
     memory_global_dirty_log_sync();
     rcu_read_lock();
     RAMBLOCK_FOREACH_NOT_IGNORED(block) {
-        migration_bitmap_sync_range(ram_state, block, 0, block->used_length);
+        migration_bitmap_sync_range(ram_state, block, block->used_length);
     }
     rcu_read_unlock();