You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The copy_slice() wrapper is used to access guest memory for most VolatileMemory methods, but there's an exception that copy_to_volatile_slice() uses std::ptr::copy(). The copy_to_volatile_slice() method should be refined to use copy_slice() so we never mix std::ptr::read/write_volatile() and std::ptr::copy()
The text was updated successfully, but these errors were encountered:
Replace std::ptr::copy() with copy_slice(). With this change applied,
most accesses to guest memory are wrapped by copy_slice() to avoid
mixing read/write_volatile() and memcpy(). The file related interfaces,
read_from()/read_exact_from()/write_to()/write_all_to(), may still
use normal memory operations.
The change causes more than 50% performance drop of
copy_to_volatile_slice() when copying 10K data buffer. The performance
drop is caused by non-optimal implemantation of copy_slice(), which
should be tracked as a dedicate issue.
Benchmarking VolatileSlice::copy_to_volatile_slice:
Collecting 200 samples in estimated 10.000 s
VolatileSlice::copy_to_volatile_slice
time: [684.24 ns 687.08 ns 691.81 ns]
change: [+134.93% +136.04% +137.32%] (p = 0.00 < 0.05)
Performance has regressed.
Found 11 outliers among 200 measurements (5.50%)
1 (0.50%) low mild
4 (2.00%) high mild
6 (3.00%) high severe
Fixes: rust-vmm#111
Signed-off-by: Liu Jiang <[email protected]>
The copy_slice() wrapper is used to access guest memory for most VolatileMemory methods, but there's an exception that copy_to_volatile_slice() uses std::ptr::copy(). The copy_to_volatile_slice() method should be refined to use copy_slice() so we never mix std::ptr::read/write_volatile() and std::ptr::copy()
The text was updated successfully, but these errors were encountered: