• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

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

Commit MetaInfo

Revisiónf30c2e5ba81b8d388b7beeae84e6db5ea8220924 (tree)
Tiempo2022-01-28 23:38:23
AutorPeter Xu <peterx@redh...>
CommiterJuan Quintela

Log Message

migration: Do chunk page in postcopy_each_ram_send_discard()

Right now we loop ramblocks for twice, the 1st time chunk the dirty bits with
huge page information; the 2nd time we send the discard ranges. That's not
necessary - we can do them in a single loop.

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>

Cambiar Resumen

Diferencia incremental

--- a/migration/ram.c
+++ b/migration/ram.c
@@ -2454,6 +2454,8 @@ static int postcopy_send_discard_bm_ram(MigrationState *ms, RAMBlock *block)
24542454 return 0;
24552455 }
24562456
2457+static void postcopy_chunk_hostpages_pass(MigrationState *ms, RAMBlock *block);
2458+
24572459 /**
24582460 * postcopy_each_ram_send_discard: discard all RAMBlocks
24592461 *
@@ -2476,6 +2478,14 @@ static int postcopy_each_ram_send_discard(MigrationState *ms)
24762478 postcopy_discard_send_init(ms, block->idstr);
24772479
24782480 /*
2481+ * Deal with TPS != HPS and huge pages. It discard any partially sent
2482+ * host-page size chunks, mark any partially dirty host-page size
2483+ * chunks as all dirty. In this case the host-page is the host-page
2484+ * for the particular RAMBlock, i.e. it might be a huge page.
2485+ */
2486+ postcopy_chunk_hostpages_pass(ms, block);
2487+
2488+ /*
24792489 * Postcopy sends chunks of bitmap over the wire, but it
24802490 * just needs indexes at this point, avoids it having
24812491 * target page specific code.
@@ -2575,7 +2585,6 @@ static void postcopy_chunk_hostpages_pass(MigrationState *ms, RAMBlock *block)
25752585 int ram_postcopy_send_discard_bitmap(MigrationState *ms)
25762586 {
25772587 RAMState *rs = ram_state;
2578- RAMBlock *block;
25792588
25802589 RCU_READ_LOCK_GUARD();
25812590
@@ -2587,15 +2596,6 @@ int ram_postcopy_send_discard_bitmap(MigrationState *ms)
25872596 rs->last_sent_block = NULL;
25882597 rs->last_page = 0;
25892598
2590- RAMBLOCK_FOREACH_NOT_IGNORED(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);
2598- }
25992599 trace_ram_postcopy_send_discard_bitmap();
26002600
26012601 return postcopy_each_ram_send_discard(ms);