mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
overcommit: introduce mem-lock=on-fault
Locking the memory without MCL_ONFAULT instantly prefaults any mmaped anonymous memory with a write-fault, which introduces a lot of extra overhead in terms of memory usage when all you want to do is to prevent kcompactd from migrating and compacting QEMU pages. Add an option to only lock pages lazily as they're faulted by the process by using MCL_ONFAULT if asked. Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru> Link: https://lore.kernel.org/r/20250212143920.1269754-5-d-tatianin@yandex-team.ru Signed-off-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
parent
cd2e472e54
commit
13057e064a
5 changed files with 45 additions and 14 deletions
|
@ -652,7 +652,7 @@ int postcopy_ram_incoming_cleanup(MigrationIncomingState *mis)
|
|||
}
|
||||
|
||||
if (should_mlock(mlock_state)) {
|
||||
if (os_mlock(false) < 0) {
|
||||
if (os_mlock(is_mlock_on_fault(mlock_state)) < 0) {
|
||||
error_report("mlock: %s", strerror(errno));
|
||||
/*
|
||||
* It doesn't feel right to fail at this point, we have a valid
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue