mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
Add option to mlock qemu and guest memory
In certain scenario, latency induced by paging is significant and memory locking is needed. Also, in the scenario with untrusted guests, latency improvement due to mlock is desired. This patch introduces a following new option to mlock guest and qemu memory: -realtime mlock=on|off Signed-off-by: Satoru Moriya <satoru.moriya@hds.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1366382526-26146-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
2b316774f6
commit
888a6bc63c
5 changed files with 65 additions and 0 deletions
12
os-posix.c
12
os-posix.c
|
@ -363,3 +363,15 @@ bool is_daemonized(void)
|
|||
{
|
||||
return daemonize;
|
||||
}
|
||||
|
||||
int os_mlock(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
ret = mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
if (ret < 0) {
|
||||
perror("mlockall");
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue