Commit 0be4835b authored by Richard Henderson's avatar Richard Henderson Committed by Blue Swirl
Browse files

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: default avatarRichard Henderson <rth@twiddle.net>
Signed-off-by: default avatarBlue Swirl <blauwirbel@gmail.com>
parent 16c6c80a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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