From: Richard Henderson Date: Thu, 1 Nov 2012 22:20:46 +0000 (+1100) Subject: exec: Advise huge pages for the TCG code gen buffer X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0be4835b4932f38167b611c2b311ebaaec98a8eb;p=qemu.git exec: Advise huge pages for the TCG code gen buffer After allocating 32MB or more contiguous memory, huge pages would seem to be ideal. Signed-off-by: Richard Henderson Signed-off-by: Blue Swirl --- diff --git a/exec.c b/exec.c index 8435de0bd2..0594b07057 100644 --- 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