qemu-patch-raspberry4/include
David Hildenbrand a384bfa32e util/oslib-posix: Support MADV_POPULATE_WRITE for os_mem_prealloc()
Let's sense support and use it for preallocation. MADV_POPULATE_WRITE
does not require a SIGBUS handler, doesn't actually touch page content,
and avoids context switches; it is, therefore, faster and easier to handle
than our current approach.

While MADV_POPULATE_WRITE is, in general, faster than manual
prefaulting, and especially faster with 4k pages, there is still value in
prefaulting using multiple threads to speed up preallocation.

More details on MADV_POPULATE_WRITE can be found in the Linux commits
4ca9b3859dac ("mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault
page tables") and eb2faa513c24 ("mm/madvise: report SIGBUS as -EFAULT for
MADV_POPULATE_(READ|WRITE)"), and in the man page proposal [1].

This resolves the TODO in do_touch_pages().

In the future, we might want to look into using fallocate(), eventually
combined with MADV_POPULATE_READ, when dealing with shared file/fd
mappings and not caring about memory bindings.

[1] https://lkml.kernel.org/r/20210816081922.5155-1-david@redhat.com

Reviewed-by: Pankaj Gupta <pankaj.gupta@ionos.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20211217134611.31172-3-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2022-01-07 05:19:55 -05:00
..
authz Prefer 'on' | 'off' over 'yes' | 'no' for bool options 2021-01-29 17:07:53 +00:00
block blockjob: drop BlockJob.blk field 2021-12-28 15:18:59 +01:00
chardev ui/dbus: add chardev backend & interface 2021-12-21 10:50:22 +04:00
crypto crypto: Make QCryptoTLSCreds* structures private 2021-06-29 18:30:24 +01:00
disas disas/nios2: Simplify endianess conversion 2021-10-22 18:07:30 +02:00
exec cpu: remove unnecessary #ifdef CONFIG_TCG 2021-12-18 10:57:36 +01:00
fpu softfloat: Add float64r32 arithmetic routines 2021-12-17 17:57:15 +01:00
hw hw/i386: expose a "smbios-entry-point-type" PC machine property 2022-01-07 05:19:55 -05:00
io io: add qio_channel_readv_full_all_eof & qio_channel_readv_full_all helpers 2021-02-10 09:23:28 +00:00
libdecnumber libdecnumber: Introduce decNumberIntegralToInt128 2021-11-09 10:32:52 +11:00
migration Fixed a QEMU hang when guest poweroff in COLO mode 2021-12-15 10:31:42 +01:00
monitor monitor: introduce HumanReadableText and HMP support 2021-11-02 15:55:13 +00:00
net virtio-net: add support for configure interrupt 2022-01-07 05:19:55 -05:00
qapi monitor: introduce HumanReadableText and HMP support 2021-11-02 15:55:13 +00:00
qemu util/oslib-posix: Support MADV_POPULATE_WRITE for os_mem_prealloc() 2022-01-07 05:19:55 -05:00
qom monitor: Fix find_device_state() for IDs containing slashes 2021-11-10 06:14:51 +01:00
scsi scsi: inline sg_io_sense_from_errno() into the callers. 2021-03-06 11:42:56 +01:00
semihosting semihosting: Move include/hw/semihosting/ -> include/semihosting/ 2021-03-10 15:34:12 +00:00
standard-headers linux-headers: update to 5.16-rc1 2021-12-10 09:47:18 +01:00
sysemu sysemu: Cleanup qemu_run_machine_init_done_notifiers() 2022-01-04 15:31:33 -08:00
tcg Initial conversion of HMP debugging commands to QMP 2021-11-03 08:04:32 -04:00
ui ui/dbus: add p2p=on/off option 2021-12-21 10:50:22 +04:00
user common-user: Move safe-syscall.* from linux-user 2021-12-20 10:12:24 -08:00
elf.h elf: Add machine type value for LoongArch 2021-12-21 13:17:06 -08:00
glib-compat.h glib-compat: Introduce g_memdup2() wrapper 2021-12-17 11:54:07 +01:00
qemu-common.h qemu-common.h: Update copyright string to 2021 2021-03-09 22:19:24 +01:00
qemu-io.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
trace-tcg.h trace: get rid of generated-events.h/generated-events.c 2016-10-12 09:54:52 +02:00