[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 24/25] tcg: Allocate a guard page after code_
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v3 24/25] tcg: Allocate a guard page after code_gen_buffer |
Date: |
Wed, 23 Sep 2015 13:37:19 -0700 |
On 23 September 2015 at 13:00, Richard Henderson <address@hidden> wrote:
> On 09/23/2015 12:39 PM, Peter Maydell wrote:
>> I think we're now doing the MADV_HUGEPAGE over "buffer size
>> minus a page" rather than "buffer size". Does that mean
>> we've gone from doing the madvise on a whole number of
>> hugepages to doing it on something that's not a whole number
>> of hugepages, and if so does the kernel decide not to use
>> hugepages here?
>
> On the whole I don't think it matters. The static buffer isn't page aligned
> to
> begin with, much less hugepage aligned, so the fact that we're allocating a
> round number like 32mb here doesn't really mean much. The beginning and/or
> end
> pages of the buffer definitely aren't going to be hugepage.
>
> Worse, the same is true for the mmap path, since I've never seen the kernel
> select a hugepage aligned address. You'd think that adding MAP_HUGEPAGE would
> be akin to MADV_HUGEPAGE, with the additional hint that the address should be
> appropriately aligned for the hugepage, but no. It implies forced use of
> something from the hugepage pool and that requires extra suid capabilities.
>
> I've wondered about over-allocating on the mmap path, so that we can choose
> the
> hugepage aligned subregion. But as far as I can tell, my kernel doesn't
> allocate hugepages at all, no matter what we do. So it seems a little silly
> to
> go so far out of the way to get an aligned buffer.
This raises the converse question of "why are we bothering with
MADV_HUGEPAGE at all?" :-)
-- PMM
- Re: [Qemu-devel] [PATCH v3 18/25] tcg: Add TCG_MAX_INSNS, (continued)
[Qemu-devel] [PATCH v3 21/25] tcg: Remove gen_intermediate_code_pc, Richard Henderson, 2015/09/22
[Qemu-devel] [PATCH v3 17/25] target-*: Drop cpu_gen_code define, Richard Henderson, 2015/09/22
[Qemu-devel] [PATCH v3 14/25] target-sparc: Remove gen_opc_jump_pc, Richard Henderson, 2015/09/22
[Qemu-devel] [PATCH v3 15/25] target-sparc: Add npc state to insn_start, Richard Henderson, 2015/09/22