Skip to content

RAMState + qdev

Juan Quintela qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest59 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/59ram: Update all functions commentsmigration/ram.c+227 -1210 replies
2/59ram: Rename flush_page_queue() to migration_page_queue_free()include/migration/migration.h migration/migration.c migration/ram.c+5 -40 replies
3/59ram: Rename block_name to rbnamemigration/ram.c+8 -90 replies
4/59ram: Create RAMStatemigration/ram.c+83 -570 replies
5/59ram: Add dirty_rate_high_cnt to RAMStatemigration/ram.c+11 -100 replies
6/59ram: Move bitmap_sync_count into RAMStatemigration/ram.c+12 -110 replies
7/59ram: Move start time into RAMStatemigration/ram.c+11 -90 replies
8/59ram: Move bytes_xfer_prev into RAMStatemigration/ram.c+7 -60 replies
9/59ram: Change byte_xfer_{prev, now} type to uint64_tmigration/ram.c+2 -20 replies
10/59ram: Move num_dirty_pages_period into RAMStatemigration/ram.c+11 -90 replies
11/59ram: Change num_dirty_pages_period type to uint64_tinclude/exec/ram_addr.h migration/ram.c+2 -20 replies
12/59ram: Move xbzrle_cache_miss_prev into RAMStatemigration/ram.c+5 -40 replies
13/59ram: Move iterations_prev into RAMStatemigration/ram.c+6 -70 replies
14/59ram: Move dup_pages into RAMStatemigration/ram.c+18 -110 replies
15/59ram: Remove unused dup_mig_bytes_transferred()include/migration/migration.h migration/ram.c+0 -60 replies
16/59ram: Remove unused pages_skipped variableinclude/migration/migration.h migration/migration.c migration/ram.c+2 -140 replies
17/59ram: Move norm_pages to RAMStatemigration/ram.c+14 -120 replies
18/59ram: Remove norm_mig_bytes_transferredinclude/migration/migration.h migration/migration.c migration/ram.c+2 -70 replies
19/59ram: Move iterations into RAMStatemigration/ram.c+7 -50 replies
20/59ram: Move xbzrle_bytes into RAMStatemigration/ram.c+5 -30 replies
21/59ram: Move xbzrle_pages into RAMStatemigration/ram.c+7 -40 replies
22/59ram: Move xbzrle_cache_miss into RAMStatemigration/ram.c+7 -50 replies
23/59ram: Move xbzrle_cache_miss_rate into RAMStatemigration/ram.c+5 -30 replies
24/59ram: Move xbzrle_overflows into RAMStatemigration/ram.c+5 -160 replies
25/59ram: Move migration_dirty_pages to RAMStatemigration/ram.c+18 -140 replies
26/59ram: Everything was init to zero, so use memsetmigration/ram.c+3 -220 replies
27/59ram: Move migration_bitmap_mutex into RAMStatemigration/ram.c+8 -70 replies
28/59ram: Move migration_bitmap_rcu into RAMStatemigration/ram.c+47 -390 replies
29/59ram: Move bytes_transferred into RAMStatemigration/ram.c+17 -180 replies
30/59ram: Use the RAMState bytes_transferred parametermigration/ram.c+27 -480 replies
31/59ram: Remove ram_save_remainingmigration/ram.c+7 -120 replies
32/59ram: Move last_req_rb to RAMStateinclude/migration/migration.h migration/migration.c migration/ram.c+5 -50 replies
33/59ram: Move src_page_req* to RAMStateinclude/migration/migration.h migration/migration.c migration/ram.c+40 -430 replies
34/59ram: Create ram_dirty_sync_count()include/migration/migration.h migration/migration.c migration/ram.c+7 -40 replies
35/59ram: Remove dirty_bytes_rateinclude/migration/migration.h migration/migration.c migration/ram.c+3 -50 replies
36/59ram: Move dirty_pages_rate to RAMStateinclude/migration/migration.h migration/migration.c migration/ram.c+13 -80 replies
37/59ram: Move postcopy_requests into RAMStateinclude/migration/migration.h migration/migration.c migration/ram.c+13 -110 replies
38/59ram: Add QEMUFile to RAMStatemigration/ram.c+10 -70 replies
39/59ram: Move QEMUFile into RAMStatemigration/ram.c+37 -470 replies
40/59ram: Remove compression_switch and inline its logicmigration/ram.c+8 -40 replies
41/59migration: Remove MigrationState from migration_in_postcopyinclude/migration/migration.h migration/migration.c migration/ram.c +1 more+17 -170 replies
42/59ram: We don't need MigrationState parameter anymoremigration/ram.c+10 -170 replies
43/59ram: Rename qemu_target_page_bits() to qemu_target_page_size()exec.c include/sysemu/sysemu.h migration/migration.c +2 more+13 -130 replies
44/59ram: Add page-size to output in 'info migrate'hmp.c migration/migration.c qapi-schema.json+8 -10 replies
45/59ram: Pass RAMBlock to bitmap_syncinclude/exec/ram_addr.h migration/ram.c+6 -40 replies
46/59ram: ram_discard_range() don't use the mis parameterinclude/migration/migration.h migration/postcopy-ram.c migration/ram.c +1 more+7 -140 replies
47/59ram: reorganize last_sent_blockmigration/ram.c+15 -210 replies
48/59ram: Use page number instead of an address for the bitmap operationsmigration/ram.c migration/trace-events+36 -440 replies
49/59ram: Remember last_page instead of last_offsetmigration/ram.c+7 -73 replies
50/59ram: Change offset field in PageSearchStatus to pagemigration/ram.c+26 -250 replies
51/59ram: Use ramblock and page offset instead of absolute offsetmigration/ram.c+28 -390 replies
52/59ram: rename last_ram_offset() last_ram_pages()exec.c include/exec/ram_addr.h migration/ram.c+9 -100 replies
53/59ram: Use RAMBitmap type for coherencemigration/ram.c+5 -50 replies
54/59migration: Remove MigrationState parameter from migration_is_idle()include/migration/migration.h migration/migration.c+4 -60 replies
55/59qdev: qdev_hotplug is really a boolhw/core/qdev.c include/hw/qdev-core.h+3 -30 replies
56/59qdev: Export qdev_hot_removedhw/core/qdev.c include/hw/qdev-core.h+2 -10 replies
57/59qdev: Move qdev_unplug() to qdev-monitor.chw/core/qdev.c qdev-monitor.c+34 -340 replies
58/59migration: Disable hotplug/unplug during migrationqdev-monitor.c+11 -00 replies
59/59ram: Remove migration_bitmap_extend()exec.c include/exec/ram_addr.h migration/ram.c+0 -370 replies

Reviews trailers per patch

All 59 patches have a Reviewed-by or Acked-by.

PatchDr. David Alan GilbertPeter XuPhilippe Mathieu-DaudéEric BlakezhanghailiangMarkus Armbruster
1/59R-b
2/59R-b R-b
3/59R-b
4/59R-b R-b
5/59R-b R-b
6/59R-b R-b
7/59R-b R-b
8/59R-b R-b
9/59R-b R-b
10/59R-b R-b
11/59R-b R-b
12/59R-b R-b
13/59R-b R-b
14/59R-b R-b
15/59R-b R-b
16/59R-b R-b
17/59R-b R-b
18/59R-b
19/59R-b
20/59R-b
21/59R-b R-b
22/59R-b R-b
23/59R-b R-b
24/59R-b R-b
25/59R-b
26/59R-b R-b
27/59R-b R-b
28/59R-b R-b
29/59R-b R-b
30/59R-b R-b
31/59R-b R-b
32/59R-b
33/59R-b
34/59R-b
35/59R-b R-b
36/59R-b R-b
37/59R-b
38/59R-b
39/59R-b
40/59R-b
41/59R-b R-b
42/59R-b R-b
43/59R-b
44/59R-b
45/59R-b
46/59R-b
47/59R-b R-b
48/59R-b
49/59R-b R-b
50/59R-b
51/59R-b
52/59R-b
53/59R-b
54/59R-b
55/59R-b R-b R-b
56/59R-b R-b
57/59R-b R-b R-b
58/59R-b
59/59R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 00/59] RAMState + qdev

Hi

Hi

This is just v3 rebased, with review-by, and the small changes suggested. I added the removal of hotmplug because they are already reviewed.

I plan to send this as migration/next for when 2.0 open.

- put all reviews
- rebase
- small changes on compression-switch
- add all the hotplug removal comments/typos/fixes

Please, comment.

Thanks, Juan.

[v3]
Contination of the previous series, addressed comments from Peter and Dave.

- All docs suggestions changed
- rename flush_page_queue to migration_page_queue()
- rebase on top of latest
- move the compression-switch logic
- change parameters to page_abs everywhere (notice that we end dropping them)

[v2]
Continuation of previous series, all review comments addressed. New things:
- Consolidate all function comments in the same style (yes, docs)
- Be much more careful with maintaining comments correct
- Move all postcopy fields to RAMState
- Move QEMUFile to RAMState
- rename qemu_target_page_bits() to qemu_target_page_size() to reflect use
- Remove MigrationState from functions that don't need it
- reorganize last_sent_block to the place where it is used/needed
- Move several places from offsets to pages
- Rename last_ram_offset() to last_ram_page() to refect use

Please comment.

[v1]
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 ...)

[v2 no-hotplug]
This updates patches with all the comments received. I move qdev_unplug() to make linux-user compile.

Please, review.

[RFC - v1 no-hotplug]
This series disable hotplug/unplug during migration. Thank to Markus for explaining where I had to put the checks. Why? Because during migration we will fail if there are changes. For instance, in postcopy, if we add a memory region, we would failing. Same for other devices if they are not setup exactly the same on destination.

Iidea would be to disable it, andthen enable for the thing that we know that work.

This series are on top of my previous RAMState v2 serie.

Commets, please?

Thanks, Juan.

Comments, please.

Chao Fan (1):
ram: Add page-size to output in 'info migrate'

Juan Quintela (58):
ram: Update all functions comments
ram: Rename flush_page_queue() to migration_page_queue_free()
ram: Rename block_name to rbname
ram: Create 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: Change byte_xfer_{prev,now} type to uint64_t
ram: Move num_dirty_pages_period into RAMState
ram: Change num_dirty_pages_period type to uint64_t
ram: Move xbzrle_cache_miss_prev into RAMState
ram: Move iterations_prev into RAMState
ram: Move dup_pages into RAMState
ram: Remove unused dup_mig_bytes_transferred()
ram: Remove unused pages_skipped 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: Move src_page_req* 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
ram: Add QEMUFile to RAMState
ram: Move QEMUFile into RAMState
ram: Remove compression_switch and inline its logic
migration: Remove MigrationState from migration_in_postcopy
ram: We don't need MigrationState parameter anymore
ram: Rename qemu_target_page_bits() to qemu_target_page_size()
ram: Pass RAMBlock to bitmap_sync
ram: ram_discard_range() don't use the mis parameter
ram: reorganize last_sent_block
ram: Use page number instead of an address for the bitmap operations
ram: Remember last_page instead of last_offset
ram: Change offset field in PageSearchStatus to page
ram: Use ramblock and page offset instead of absolute offset
ram: rename last_ram_offset() last_ram_pages()
ram: Use RAMBitmap type for coherence
migration: Remove MigrationState parameter from migration_is_idle()
qdev: qdev_hotplug is really a bool
qdev: Export qdev_hot_removed
qdev: Move qdev_unplug() to qdev-monitor.c
migration: Disable hotplug/unplug during migration
ram: Remove migration_bitmap_extend()

 exec.c                        |   11 +-
 hmp.c                         |    3 +
 hw/core/qdev.c                |   40 +-
 include/exec/ram_addr.h       |    8 +-
 include/hw/qdev-core.h        |    3 +-
 include/migration/migration.h |   41 +-
 include/sysemu/sysemu.h       |    2 +-
 migration/migration.c         |   44 +-
 migration/postcopy-ram.c      |   14 +-
 migration/ram.c               | 1210 +++++++++++++++++++++--------------------
 migration/savevm.c            |   15 +-
 migration/trace-events        |    4 +-
 qapi-schema.json              |    5 +-
 qdev-monitor.c                |   45 ++
 14 files changed, 741 insertions(+), 704 deletions(-)
Signature · 1 line
2.9.3