[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] exec: optimize phys_page_set_level
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH] exec: optimize phys_page_set_level |
Date: |
Fri, 22 May 2015 09:01:08 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Thu, May 21, 2015 at 03:19:58PM +0200, Paolo Bonzini wrote:
> phys_page_set_level is writing zeroes to a struct that has just been
> filled in by phys_map_node_alloc. Instead, tell phys_map_node_alloc
> whether to fill in the page "as a leaf" or "as a non-leaf".
>
> memcpy is faster than struct assignment, which copies each bitfield
> individually. Arguably a compiler bug, but memcpy is super-special
> cased anyway so what could go wrong?
>
> This cuts the cost of phys_page_set_level from 25% to 5% when
> booting qboot.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> exec.c | 24 ++++++++++--------------
> 1 file changed, 10 insertions(+), 14 deletions(-)
Reviewed-by: Stefan Hajnoczi <address@hidden>
pgpxfg9v8kBsN.pgp
Description: PGP signature