mirror_qemu/include
Jitendra Kolhe 1e356fc14b mem-prealloc: reduce large guest start-up and migration time.
Using "-mem-prealloc" option for a large guest leads to higher guest
start-up and migration time. This is because with "-mem-prealloc" option
qemu tries to map every guest page (create address translations), and
make sure the pages are available during runtime. virsh/libvirt by
default, seems to use "-mem-prealloc" option in case the guest is
configured to use huge pages. The patch tries to map all guest pages
simultaneously by spawning multiple threads. Currently limiting the
change to QEMU library functions on POSIX compliant host only, as we are
not sure if the problem exists on win32. Below are some stats with
"-mem-prealloc" option for guest configured to use huge pages.

------------------------------------------------------------------------
Idle Guest      | Start-up time | Migration time
------------------------------------------------------------------------
Guest stats with 2M HugePage usage - single threaded (existing code)
------------------------------------------------------------------------
64 Core - 4TB   | 54m11.796s    | 75m43.843s
64 Core - 1TB   | 8m56.576s     | 14m29.049s
64 Core - 256GB | 2m11.245s     | 3m26.598s
------------------------------------------------------------------------
Guest stats with 2M HugePage usage - map guest pages using 8 threads
------------------------------------------------------------------------
64 Core - 4TB   | 5m1.027s      | 34m10.565s
64 Core - 1TB   | 1m10.366s     | 8m28.188s
64 Core - 256GB | 0m19.040s     | 2m10.148s
-----------------------------------------------------------------------
Guest stats with 2M HugePage usage - map guest pages using 16 threads
-----------------------------------------------------------------------
64 Core - 4TB   | 1m58.970s     | 31m43.400s
64 Core - 1TB   | 0m39.885s     | 7m55.289s
64 Core - 256GB | 0m11.960s     | 2m0.135s
-----------------------------------------------------------------------

Changed in v2:
 - modify number of memset threads spawned to min(smp_cpus, 16).
 - removed 64GB memory restriction for spawning memset threads.

Changed in v3:
 - limit number of threads spawned based on
   min(sysconf(_SC_NPROCESSORS_ONLN), 16, smp_cpus)
 - implement memset thread specific siglongjmp in SIGBUS signal_handler.

Changed in v4
 - remove sigsetjmp/siglongjmp and SIGBUS unblock/block for main thread
   as main thread no longer touches any pages.
 - simplify code my returning memset_thread_failed status from
   touch_all_pages.

Signed-off-by: Jitendra Kolhe <jitendra.kolhe@hpe.com>
Message-Id: <1487907103-32350-1-git-send-email-jitendra.kolhe@hpe.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-03-14 13:26:36 +01:00
..
block block: Fix error handling in bdrv_replace_in_backing_chain() 2017-03-07 14:53:28 +01:00
crypto crypto: add CTR mode support 2016-10-19 10:09:24 +01:00
disas Fix Thumb-1 BE32 execution and disassembly. 2017-02-07 18:29:59 +00:00
exec memory_region: Fix name comments 2017-03-14 13:26:36 +01:00
fpu softfloat: Add float128_to_uint32_round_to_zero() 2017-02-22 11:28:28 +11:00
hw pseries: Don't expose PCIe extended config space on older machine types 2017-03-14 11:54:17 +11:00
io io: make qio_channel_yield aware of AioContexts 2017-02-21 11:14:07 +00:00
libdecnumber Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
migration postcopy: Use temporary for placing zero huge pages 2017-02-28 11:30:23 +00:00
monitor qmp: Dumb down how we run QMP command registration 2017-03-05 09:02:10 +01:00
net eth: Extend vlan stripping functions 2017-03-06 11:46:02 +08:00
qapi qapi: New qobject_input_visitor_new_str() for convenience 2017-03-07 16:07:47 +01:00
qemu mem-prealloc: reduce large guest start-up and migration time. 2017-03-14 13:26:36 +01:00
qom Merge branch 'icount-update' into HEAD 2017-03-03 16:39:18 +01:00
standard-headers update Linux headers to 4.11 2017-02-28 16:18:49 +00:00
sysemu build: include sys/sysmacros.h for major() and minor() 2017-03-14 10:08:22 +00:00
ui gtk-egl: add scanout_disable support 2017-02-27 16:15:29 +01:00
elf.h nios2: Add usermode binaries emulation 2017-01-24 13:10:35 -08:00
glib-compat.h glib-compat: add g_test_add_data_func_full fallback 2017-03-01 00:09:28 +04:00
qemu-common.h Update copyright year 2017-02-28 09:03:39 +03:00
qemu-io.h hmp: Request permissions in qemu-io 2017-02-28 20:47:50 +01:00
trace-tcg.h trace: get rid of generated-events.h/generated-events.c 2016-10-12 09:54:52 +02:00