[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] util: align memory allocations to 2M on AArc
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v2] util: align memory allocations to 2M on AArch64 |
Date: |
Fri, 22 Apr 2016 12:58:38 +0100 |
On 22 April 2016 at 12:12, Christoffer Dall <address@hidden> wrote:
> For KVM to use Transparent Huge Pages (THP) we have to ensure that the
> alignment of the userspace address of the KVM memory slot and the IPA
> that the guest sees for a memory region have the same offset from the 2M
> huge page size boundary.
>
> One way to achieve this is to always align the IPA region at a 2M
> boundary and ensure that the mmap alignment is also at 2M.
>
> Unfortunately, we were only doing this for __arm__, not for __aarch64__,
> so add this simply condition.
>
> This fixes a performance regression using KVM/ARM on AArch64 platforms
> that showed a performance penalty of more than 50%, introduced by the
> following commit:
>
> 9fac18f (oslib: allocate PROT_NONE pages on top of RAM, 2015-09-10)
>
> We were only lucky before the above commit, because we were allocating
> large regions and naturally getting a 2M alignment on those allocations
> then.
>
> Reported-by: Shih-Wei Li <address@hidden>
> Signed-off-by: Christoffer Dall <address@hidden>
> ---
> The first version of this patch was accidentally made against the v2.5.0
> release instead of master, so this is a rebased version.
Thanks; applied to master (with the long line wrapped).
-- PMM