qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Riku Voipio <riku.voipio@iki.fi>
To: Kirill Batuzov <batuzovk@ispras.ru>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH, RFT] Speedup 'tb_find_slow' by using the same heuristic as during memory page lookup
Date: Tue, 23 Nov 2010 14:38:04 +0200	[thread overview]
Message-ID: <20101123123804.GA18003@afflict.kos.to> (raw)
In-Reply-To: <4CEAC792.7040307@ispras.ru>

Hi,

tested and improves indeed startup speed.

On Mon, Nov 22, 2010 at 10:42:10PM +0300, Kirill Batuzov wrote:
> Move the last found TB to the head of the list so it will be found more  
> quickly next time it will be looked for.
>
> Signed-off-by: Kirill Batuzov <batuzovk@ispras.ru>
> Signed-off-by: Pavel Yushchenko <pau@ispras.ru>
> ---
> Hello.  This patch gives significant boost to a used by us rather rich  
> (for embedded one - featuring X-server, many daemons and applications)  
> ARM-based system literally decreasing its boot to desktop time by TWO  
> times!  (Average number of traversed 'tb_phys_hash' entries in the main  
> loop of the 'tb_find_slow' function reduced from 20 to 1.5.)  We were  
> able to shorten boot to login time by about 25% as well using Debian on  
> versatilepb (no X-server, only basic system). Seems like kernel booting  
> time is not affected.  No problems were encountered during our 
> experiments.
>
> We are looking forward for comments about this change and help with  
> testing. Thanks in advance!
>
>  cpu-exec.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/cpu-exec.c b/cpu-exec.c
> index 5d6dd51..55c4526 100644
> --- a/cpu-exec.c
> +++ b/cpu-exec.c
> @@ -161,6 +161,11 @@ static TranslationBlock *tb_find_slow(target_ulong pc,
>      tb = tb_gen_code(env, pc, cs_base, flags, 0);
>
>   found:
> +    if (*ptb1) {
> +        *ptb1 = tb->phys_hash_next;
> +        tb->phys_hash_next = tb_phys_hash[h];
> +        tb_phys_hash[h] = tb;
> +    }
>      /* we add the TB in the virtual pc hash table */
>      env->tb_jmp_cache[tb_jmp_cache_hash_func(pc)] = tb;
>      return tb;

  reply	other threads:[~2010-11-23 12:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-22 19:42 [Qemu-devel] [PATCH, RFT] Speedup 'tb_find_slow' by using the same heuristic as during memory page lookup Kirill Batuzov
2010-11-23 12:38 ` Riku Voipio [this message]
2010-11-23 16:23 ` Mulyadi Santosa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101123123804.GA18003@afflict.kos.to \
    --to=riku.voipio@iki.fi \
    --cc=batuzovk@ispras.ru \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).