• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

コミットメタ情報

リビジョンe3fbf760218fe06d0c95bb595774c76206219e2f (tree)
日時2022-01-28 23:38:23
作者Peter Xu <peterx@redh...>
コミッターJuan Quintela

ログメッセージ

migration: Drop postcopy_chunk_hostpages()

This function calls three functions:

- postcopy_discard_send_init(ms, block->idstr);
- postcopy_chunk_hostpages_pass(ms, block);
- postcopy_discard_send_finish(ms);

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>

変更サマリ

差分

--- a/migration/ram.c
+++ b/migration/ram.c
@@ -2558,30 +2558,6 @@ static void postcopy_chunk_hostpages_pass(MigrationState *ms, RAMBlock *block)
25582558 }
25592559
25602560 /**
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-/**
25852561 * ram_postcopy_send_discard_bitmap: transmit the discard bitmap
25862562 *
25872563 * Returns zero on success
@@ -2612,8 +2588,13 @@ int ram_postcopy_send_discard_bitmap(MigrationState *ms)
26122588 rs->last_page = 0;
26132589
26142590 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);
26172598 }
26182599 trace_ram_postcopy_send_discard_bitmap();
26192600