Files
kvmtool/include
Sasha Levin 5d4d9902fa kvm tools: Use mmap by default for disk images
Use mmap() for disk images and fallback to read()/write() if it fails (for
example, with large images on 32 bit systems).

Performance (kB/s) test using bonnie++ shows 19% improvement in block writes,
7% improvement in block rewrites, and 6% improvement in block reads.

Guest was started with the following command:

  ./kvm run --mem=256 --image=./work/vms/gentoo.img --kernel=/boot/bzImage-git

and bonnie++ with:

  bonnie++ -u 0

Before:
------

  Version  1.96       ------Sequential Output----- --Sequential Input- -Random-
  Concurrency   1     -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
  Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
  tux            480M   673 100 308017  61 288156  49  3286  99 892186  76 +++++ +++
  Latency             12998us   50992us   35993us    3000us    1999us     201ms
  Version  1.96       ------Sequential Create------ --------Random Create--------
  tux                 -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
                files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                   16 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++
  Latency              3000us    1000us    1000us    1000us    1998us    1000us

After:
------

  Version  1.96       ------Sequential Output------ --Sequential Input- --Random-
  Concurrency   1     -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
  Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
  tux            480M   674  99 366588  42 309514  44  3539  99 954554  76 +++++ +++
  Latency             17997us   15997us   37993us    4999us    1998us     145ms
  Version  1.96       ------Sequential Create------ --------Random Create--------
  tux                 -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
                files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                   16 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++
  Latency              1000us    1000us    2000us    1999us    1000us    1000us

[ penberg@kernel.org: drop MAP_NORESERVE, it's no-op for MAP_SHARED ]
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
2015-06-01 16:39:42 +01:00
..