リビジョン | e3fbf760218fe06d0c95bb595774c76206219e2f (tree) |
---|---|
日時 | 2022-01-28 23:38:23 |
作者 | Peter Xu <peterx@redh...> |
コミッター | Juan Quintela |
migration: Drop postcopy_chunk_hostpages()
This function calls three functions:
However only the 2nd function call is meaningful. It's major role is to make
sure dirty bits are applied in host-page-size granule, so there will be no
partial dirty bits set for a whole host page if huge pages are used.
The 1st/3rd call are for latter when we want to send the disgard ranges.
They're mostly no-op here besides some tracepoints (which are misleading!).
Drop them, then we can directly drop postcopy_chunk_hostpages() as a whole
because we can call postcopy_chunk_hostpages_pass() directly.
There're still some nice comments above postcopy_chunk_hostpages() that explain
what it does. Copy it over to the caller's site.
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
@@ -2558,30 +2558,6 @@ static void postcopy_chunk_hostpages_pass(MigrationState *ms, RAMBlock *block) | ||
2558 | 2558 | } |
2559 | 2559 | |
2560 | 2560 | /** |
2561 | - * postcopy_chunk_hostpages: discard any partially sent host page | |
2562 | - * | |
2563 | - * Utility for the outgoing postcopy code. | |
2564 | - * | |
2565 | - * Discard any partially sent host-page size chunks, mark any partially | |
2566 | - * dirty host-page size chunks as all dirty. In this case the host-page | |
2567 | - * is the host-page for the particular RAMBlock, i.e. it might be a huge page | |
2568 | - * | |
2569 | - * @ms: current migration state | |
2570 | - * @block: block we want to work with | |
2571 | - */ | |
2572 | -static void postcopy_chunk_hostpages(MigrationState *ms, RAMBlock *block) | |
2573 | -{ | |
2574 | - postcopy_discard_send_init(ms, block->idstr); | |
2575 | - | |
2576 | - /* | |
2577 | - * Ensure that all partially dirty host pages are made fully dirty. | |
2578 | - */ | |
2579 | - postcopy_chunk_hostpages_pass(ms, block); | |
2580 | - | |
2581 | - postcopy_discard_send_finish(ms); | |
2582 | -} | |
2583 | - | |
2584 | -/** | |
2585 | 2561 | * ram_postcopy_send_discard_bitmap: transmit the discard bitmap |
2586 | 2562 | * |
2587 | 2563 | * Returns zero on success |
@@ -2612,8 +2588,13 @@ int ram_postcopy_send_discard_bitmap(MigrationState *ms) | ||
2612 | 2588 | rs->last_page = 0; |
2613 | 2589 | |
2614 | 2590 | RAMBLOCK_FOREACH_NOT_IGNORED(block) { |
2615 | - /* Deal with TPS != HPS and huge pages */ | |
2616 | - postcopy_chunk_hostpages(ms, block); | |
2591 | + /* | |
2592 | + * Deal with TPS != HPS and huge pages. It discard any partially sent | |
2593 | + * host-page size chunks, mark any partially dirty host-page size | |
2594 | + * chunks as all dirty. In this case the host-page is the host-page | |
2595 | + * for the particular RAMBlock, i.e. it might be a huge page. | |
2596 | + */ | |
2597 | + postcopy_chunk_hostpages_pass(ms, block); | |
2617 | 2598 | } |
2618 | 2599 | trace_ram_postcopy_send_discard_bitmap(); |
2619 | 2600 |