[Qemu-devel] [PATCH 00/31] Creating RAMState for migration

Juan Quintela posted 31 patches 8 years, 7 months ago
Failed in applying to current master (apply log)
Test checkpatch failed
Test docker passed
Test s390x passed
There is a newer version of this series
include/migration/migration.h |  14 +-
migration/migration.c         |  21 +-
migration/ram.c               | 594 +++++++++++++++++++++---------------------
3 files changed, 303 insertions(+), 326 deletions(-)
[Qemu-devel] [PATCH 00/31] Creating RAMState for migration
Posted by Juan Quintela 8 years, 7 months ago
Hi

Currently, we have several places where we store informaticon about
ram for migration pruposes:
- global variables on migration/ram.c
- inside the accounting_info struct in migration/ram.c
  notice that not all the accounting vars are inside there
- some stuff is in MigrationState, althought it belongs to migrate/ram.c

So, this series does:
- move everything related to ram.c to RAMState struct
- make all the statistics consistent, exporting them with an accessor
  function

Why now?

Because I am trying to do some more optimizations about how we send
data around and it is basically impossible to do with current code, we
still need to add more variables.  Notice that there are things like that:
- accounting info was only reset if we had xbzrle enabled
- How/where to initialize variables are completely inconsistent.



To Do:

- There are still places that access directly the global struct.
  Mainly postcopy.  We could finfd a way to make a pointer to the
  current migration.  If people like the approach, I will search where
  to put it.
- I haven't posted any real change here, this is just the move of
  variables to the struct and pass the struct around.  Optimizations
  will came after.

- Consolidate XBZRLE, Compression params, etc in its own structs
  (inside or not RAMState, to be able to allocate ones, others, or
  ...)

Comments, please.


Juan Quintela (31):
  ram: move more fields into RAMState
  ram: Add dirty_rate_high_cnt to RAMState
  ram: move bitmap_sync_count into RAMState
  ram: Move start time into RAMState
  ram: Move bytes_xfer_prev into RAMState
  ram: Move num_dirty_pages_period into RAMState
  ram: Move xbzrle_cache_miss_prev into RAMState
  ram: Move iterations_prev into RAMState
  ram: Move dup_pages into RAMState
  ram: Remove unused dump_mig_dbytes_transferred()
  ram: Remove unused pages_skiped variable
  ram: Move norm_pages to RAMState
  ram: Remove norm_mig_bytes_transferred
  ram: Move iterations into RAMState
  ram: Move xbzrle_bytes into RAMState
  ram: Move xbzrle_pages into RAMState
  ram: Move xbzrle_cache_miss into RAMState
  ram: move xbzrle_cache_miss_rate into RAMState
  ram: move xbzrle_overflows into RAMState
  ram: move migration_dirty_pages to RAMState
  ram: Everything was init to zero, so use memset
  ram: move migration_bitmap_mutex into RAMState
  ram: Move migration_bitmap_rcu into RAMState
  ram: Move bytes_transferred into RAMState
  ram: Use the RAMState bytes_transferred parameter
  ram: Remove ram_save_remaining
  ram: Move last_req_rb to RAMState
  ram: Create ram_dirty_sync_count()
  ram: Remove dirty_bytes_rate
  ram: move dirty_pages_rate to RAMState
  ram: move postcopy_requests into RAMState

 include/migration/migration.h |  14 +-
 migration/migration.c         |  21 +-
 migration/ram.c               | 594 +++++++++++++++++++++---------------------
 3 files changed, 303 insertions(+), 326 deletions(-)

-- 
2.9.3


Re: [Qemu-devel] [PATCH 00/31] Creating RAMState for migration
Posted by no-reply@patchew.org 8 years, 7 months ago
Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20170315135021.6978-1-quintela@redhat.com
Subject: [Qemu-devel] [PATCH 00/31] Creating RAMState for migration

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

# Useful git options
git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20170315135021.6978-1-quintela@redhat.com -> patchew/20170315135021.6978-1-quintela@redhat.com
 * [new tag]         patchew/20170315142032.6788-1-shorne@gmail.com -> patchew/20170315142032.6788-1-shorne@gmail.com
Switched to a new branch 'test'
6fe577e ram: move postcopy_requests into RAMState
f53e389 ram: move dirty_pages_rate to RAMState
3484779 ram: Remove dirty_bytes_rate
1d9f0c2 ram: Create ram_dirty_sync_count()
afa30a7 ram: Move last_req_rb to RAMState
b6c274d ram: Remove ram_save_remaining
40aa7d1 ram: Use the RAMState bytes_transferred parameter
c160baf ram: Move bytes_transferred into RAMState
d4507b7 ram: Move migration_bitmap_rcu into RAMState
06e4d78 ram: move migration_bitmap_mutex into RAMState
a97081e ram: Everything was init to zero, so use memset
f0575a7 ram: move migration_dirty_pages to RAMState
2d35060 ram: move xbzrle_overflows into RAMState
8b9c459 ram: move xbzrle_cache_miss_rate into RAMState
a69643a ram: Move xbzrle_cache_miss into RAMState
b56f54b ram: Move xbzrle_pages into RAMState
6771534 ram: Move xbzrle_bytes into RAMState
d921876 ram: Move iterations into RAMState
174f925 ram: Remove norm_mig_bytes_transferred
5523509 ram: Move norm_pages to RAMState
abf8516 ram: Remove unused pages_skiped variable
fad4269 ram: Remove unused dump_mig_dbytes_transferred()
b1d44ad ram: Move dup_pages into RAMState
bbe7d75 ram: Move iterations_prev into RAMState
9d4c5c4 ram: Move xbzrle_cache_miss_prev into RAMState
de4f910 ram: Move num_dirty_pages_period into RAMState
c94e9c4 ram: Move bytes_xfer_prev into RAMState
84ef592 ram: Move start time into RAMState
e967ab5 ram: move bitmap_sync_count into RAMState
a9b59ac ram: Add dirty_rate_high_cnt to RAMState
620e9e6 ram: move more fields into RAMState

=== OUTPUT BEGIN ===
Checking PATCH 1/31: ram: move more fields into RAMState...
WARNING: line over 80 characters
#201: FILE: migration/ram.c:1121:
+static bool get_queued_page(RAMState *rs, MigrationState *ms, PageSearchStatus *pss,

ERROR: trailing whitespace
#433: FILE: migration/ram.c:2120:
+    $

total: 1 errors, 1 warnings, 400 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 2/31: ram: Add dirty_rate_high_cnt to RAMState...
Checking PATCH 3/31: ram: move bitmap_sync_count into RAMState...
Checking PATCH 4/31: ram: Move start time into RAMState...
Checking PATCH 5/31: ram: Move bytes_xfer_prev into RAMState...
ERROR: spaces required around that '/' (ctx:VxV)
#55: FILE: migration/ram.c:678:
+                   (bytes_xfer_now - rs->bytes_xfer_prev)/2) &&
                                                          ^

total: 1 errors, 0 warnings, 48 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 6/31: ram: Move num_dirty_pages_period into RAMState...
Checking PATCH 7/31: ram: Move xbzrle_cache_miss_prev into RAMState...
Checking PATCH 8/31: ram: Move iterations_prev into RAMState...
Checking PATCH 9/31: ram: Move dup_pages into RAMState...
Checking PATCH 10/31: ram: Remove unused dump_mig_dbytes_transferred()...
Checking PATCH 11/31: ram: Remove unused pages_skiped variable...
Checking PATCH 12/31: ram: Move norm_pages to RAMState...
Checking PATCH 13/31: ram: Remove norm_mig_bytes_transferred...
Checking PATCH 14/31: ram: Move iterations into RAMState...
Checking PATCH 15/31: ram: Move xbzrle_bytes into RAMState...
Checking PATCH 16/31: ram: Move xbzrle_pages into RAMState...
Checking PATCH 17/31: ram: Move xbzrle_cache_miss into RAMState...
Checking PATCH 18/31: ram: move xbzrle_cache_miss_rate into RAMState...
Checking PATCH 19/31: ram: move xbzrle_overflows into RAMState...
Checking PATCH 20/31: ram: move migration_dirty_pages to RAMState...
ERROR: spaces prohibited around that '->' (ctx:VxW)
#62: FILE: migration/ram.c:587:
+    rs-> migration_dirty_pages +=
       ^

WARNING: line over 80 characters
#89: FILE: migration/ram.c:648:
+    rs->num_dirty_pages_period += rs->migration_dirty_pages - num_dirty_pages_init;

WARNING: line over 80 characters
#128: FILE: migration/ram.c:1776:
+                ram_state.migration_dirty_pages += !test_and_set_bit(page, bitmap);

total: 1 errors, 2 warnings, 117 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 21/31: ram: Everything was init to zero, so use memset...
Checking PATCH 22/31: ram: move migration_bitmap_mutex into RAMState...
Checking PATCH 23/31: ram: Move migration_bitmap_rcu into RAMState...
Checking PATCH 24/31: ram: Move bytes_transferred into RAMState...
Checking PATCH 25/31: ram: Use the RAMState bytes_transferred parameter...
WARNING: line over 80 characters
#56: FILE: migration/ram.c:711:
+                                                  offset | RAM_SAVE_FLAG_COMPRESS);

WARNING: line over 80 characters
#244: FILE: migration/ram.c:1316:
+        tmppages = ram_save_target_page(rs, ms, f, pss, last_stage, dirty_ram_abs);

WARNING: line over 80 characters
#271: FILE: migration/ram.c:1379:
+            pages = ram_save_host_page(rs, ms, f, &pss, last_stage, dirty_ram_abs);

total: 0 errors, 3 warnings, 255 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 26/31: ram: Remove ram_save_remaining...
Checking PATCH 27/31: ram: Move last_req_rb to RAMState...
Checking PATCH 28/31: ram: Create ram_dirty_sync_count()...
Checking PATCH 29/31: ram: Remove dirty_bytes_rate...
ERROR: line over 90 characters
#42: FILE: migration/migration.c:2002:
+                s->expected_downtime = s->dirty_pages_rate * (1ul << qemu_target_page_bits())/ bandwidth;

ERROR: spaces required around that '/' (ctx:VxW)
#42: FILE: migration/migration.c:2002:
+                s->expected_downtime = s->dirty_pages_rate * (1ul << qemu_target_page_bits())/ bandwidth;
                                                                                              ^

total: 2 errors, 0 warnings, 31 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 30/31: ram: move dirty_pages_rate to RAMState...
ERROR: line over 90 characters
#61: FILE: migration/migration.c:2001:
+                s->expected_downtime = ram_dirty_pages_rate() * (1ul << qemu_target_page_bits())/ bandwidth;

ERROR: spaces required around that '/' (ctx:VxW)
#61: FILE: migration/migration.c:2001:
+                s->expected_downtime = ram_dirty_pages_rate() * (1ul << qemu_target_page_bits())/ bandwidth;
                                                                                                 ^

total: 2 errors, 0 warnings, 81 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 31/31: ram: move postcopy_requests into RAMState...
=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org