]> Git Repo - qemu.git/commitdiff
exec: Advise huge pages for the TCG code gen buffer
authorRichard Henderson <[email protected]>
Thu, 1 Nov 2012 22:20:46 +0000 (09:20 +1100)
committerBlue Swirl <[email protected]>
Sat, 8 Dec 2012 14:18:37 +0000 (14:18 +0000)
After allocating 32MB or more contiguous memory, huge pages
would seem to be ideal.

Signed-off-by: Richard Henderson <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
exec.c

diff --git a/exec.c b/exec.c
index 8435de0bd2f9248e9050db27ff7fbd78eb4351f8..0594b0705736c124857b3c1993690e7ca5848f6b 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -607,6 +607,8 @@ static inline void code_gen_alloc(size_t tb_size)
         exit(1);
     }
 
+    qemu_madvise(code_gen_buffer, code_gen_buffer_size, QEMU_MADV_HUGEPAGE);
+
     /* Steal room for the prologue at the end of the buffer.  This ensures
        (via the MAX_CODE_GEN_BUFFER_SIZE limits above) that direct branches
        from TB's to the prologue are going to be in range.  It also means
This page took 0.029363 seconds and 4 git commands to generate.