From 888a6bc63c94ef34026399117ebf6a1fa0e7a29a Mon Sep 17 00:00:00 2001 From: Satoru Moriya Date: Fri, 19 Apr 2013 16:42:06 +0200 Subject: 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 Reviewed-by: Paolo Bonzini Reviewed-by: Marcelo Tosatti Signed-off-by: Paolo Bonzini Message-id: 1366382526-26146-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori --- include/sysemu/os-posix.h | 1 + include/sysemu/os-win32.h | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'include') diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h index 7f198e475c..25d0b2a73f 100644 --- a/include/sysemu/os-posix.h +++ b/include/sysemu/os-posix.h @@ -31,6 +31,7 @@ void os_set_proc_name(const char *s); void os_setup_signal_handling(void); void os_daemonize(void); void os_setup_post(void); +int os_mlock(void); typedef struct timeval qemu_timeval; #define qemu_gettimeofday(tp) gettimeofday(tp, NULL) diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h index 71f5fa0a91..bf8523ada1 100644 --- a/include/sysemu/os-win32.h +++ b/include/sysemu/os-win32.h @@ -106,4 +106,9 @@ static inline bool is_daemonized(void) return false; } +static inline int os_mlock(void) +{ + return -ENOSYS; +} + #endif -- cgit v1.2.3-55-g7522