qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 0/6] migration: reduce time of loading non-iterable vmstate
@ 2023-03-10  2:24 Chuang Xu
  2023-03-10  2:24 ` [PATCH v7 1/6] memory: Reference as->current_map directly in memory commit Chuang Xu
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Chuang Xu @ 2023-03-10  2:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: dgilbert, quintela, pbonzini, peterx, david, philmd, zhouyibo


In this version:

- introduce address_space_to_flatview_rcu()
- squash peter's fix into patch 1
- rebase to latest upstream
- update test results

The duration of loading non-iterable vmstate accounts for a significant
portion of downtime (starting with the timestamp of source qemu stop and
ending with the timestamp of target qemu start). Most of the time is spent
committing memory region changes repeatedly.

This patch packs all the changes to memory region during the period of	
loading non-iterable vmstate in a single memory transaction. With the
increase of devices, this patch will greatly improve the performance.

Here are the test1 results:
test info:
- Host
  - Intel(R) Xeon(R) Platinum 8362 CPU
  - Mellanox Technologies MT28841
- VM
  - 32 CPUs 128GB RAM VM
  - 8 16-queue vhost-net device
  - 16 4-queue vhost-user-blk device.

	time of loading non-iterable vmstate     downtime
before		 112 ms			  	  285 ms
after		 20 ms			  	  194 ms


In test2, we keep the number of the device the same as test1, reduce the 
number of queues per device:

Here are the test2 results:
test info:
- Host
  - Intel(R) Xeon(R) Platinum 8362 CPU
  - Mellanox Technologies MT28841
- VM
  - 32 CPUs 128GB RAM VM
  - 8 1-queue vhost-net device
  - 16 1-queue vhost-user-blk device.

	time of loading non-iterable vmstate     downtime
before		 65 ms			 	  151 ms

after		 19 ms			  	  100 ms


In test3, we keep the number of queues per device the same as test1, reduce 
the number of devices:

Here are the test3 results:
test info:
- Host
  - Intel(R) Xeon(R) Platinum 8362 CPU
  - Mellanox Technologies MT28841
- VM
  - 32 CPUs 128GB RAM VM
  - 1 16-queue vhost-net device
  - 1 4-queue vhost-user-blk device.

	time of loading non-iterable vmstate     downtime
before		 24 ms			  	  51 ms
after		 9 ms			 	  36 ms


As we can see from the test results above, both the number of queues and 
the number of devices have a great impact on the time of loading non-iterable 
vmstate. The growth of the number of devices and queues will lead to more 
mr commits, and the time consumption caused by the flatview reconstruction 
will also increase.

Please review, Chuang

[v6]

- add peter's patch.
- split mr_do_commit() from mr_commit().
- adjust the sanity check in address_space_to_flatview().
- rebase to latest upstream.
- replace 8260 with 8362 as testing host.
- update the latest test results.

[v5]

- rename rcu_read_locked() to rcu_read_is_locked().
- adjust the sanity check in address_space_to_flatview().
- improve some comments.

[v4]

- attach more information in the cover letter.
- remove changes on virtio_load.
- add rcu_read_locked() to detect holding of rcu lock.

[v3]

- move virtio_load_check_delay() from virtio_memory_listener_commit() to 
  virtio_vmstate_change().
- add delay_check flag to VirtIODevice to make sure virtio_load_check_delay() 
  will be called when delay_check is true.

[v2]

- rebase to latest upstream.
- add sanity check to address_space_to_flatview().
- postpone the init of the vring cache until migration's loading completes. 

[v1]

The duration of loading non-iterable vmstate accounts for a significant
portion of downtime (starting with the timestamp of source qemu stop and
ending with the timestamp of target qemu start). Most of the time is spent
committing memory region changes repeatedly.

This patch packs all the changes to memory region during the period of
loading non-iterable vmstate in a single memory transaction. With the
increase of devices, this patch will greatly improve the performance.

Here are the test results:
test vm info:
- 32 CPUs 128GB RAM
- 8 16-queue vhost-net device
- 16 4-queue vhost-user-blk device.

	time of loading non-iterable vmstate
before		about 210 ms
after		about 40 ms





^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-03-16 10:47 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-10  2:24 [PATCH v7 0/6] migration: reduce time of loading non-iterable vmstate Chuang Xu
2023-03-10  2:24 ` [PATCH v7 1/6] memory: Reference as->current_map directly in memory commit Chuang Xu
2023-03-14 11:25   ` David Edmondson
2023-03-10  2:24 ` [PATCH v7 2/6] rcu: Introduce rcu_read_is_locked() Chuang Xu
2023-03-10 14:50   ` Peter Xu
2023-03-10  2:24 ` [PATCH v7 3/6] memory: Introduce memory_region_transaction_do_commit() Chuang Xu
2023-03-10 14:51   ` Peter Xu
2023-03-13  2:53     ` Chuang Xu
2023-03-10  2:24 ` [PATCH v7 4/6] memory: Add sanity check in address_space_to_flatview Chuang Xu
2023-03-10 14:56   ` Peter Xu
2023-03-10  2:24 ` [PATCH v7 5/6] migration: Reduce time of loading non-iterable vmstate Chuang Xu
2023-03-10 14:58   ` Peter Xu
2023-03-16 10:46   ` Juan Quintela
2023-03-10  2:24 ` [PATCH v7 6/6] memory: Introduce address_space_to_flatview_rcu() Chuang Xu
2023-03-10 15:08   ` Peter Xu
2023-03-13  8:38     ` Chuang Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).