From: Paolo Bonzini <pbonzini@redhat.com>
To: Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>, qemu-devel@nongnu.org
Cc: alex.bennee@linaro.org
Subject: Re: [PATCH] icount: improve exec nocache usage
Date: Fri, 11 Dec 2020 21:55:04 +0100 [thread overview]
Message-ID: <a019bf2e-c20e-3465-42de-44a8271d5828@redhat.com> (raw)
In-Reply-To: <160741865825.348476.7169239332367828943.stgit@pasha-ThinkPad-X280>
On 08/12/20 10:10, Pavel Dovgalyuk wrote:
> cpu-exec tries to execute TB without caching when current
> icount budget is over. But sometimes refilled budget is big
> enough to try executing cached blocks.
> This patch checks that instruction budget is big enough
> for next block execution instead of just running cpu_exec_nocache.
> It halves the number of calls of cpu_exec_nocache function
> during tested OS boot scenario.
>
> Signed-off-by: Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>
> ---
> accel/tcg/cpu-exec.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
> index 58aea605d8..251b340fb9 100644
> --- a/accel/tcg/cpu-exec.c
> +++ b/accel/tcg/cpu-exec.c
> @@ -685,7 +685,7 @@ static inline void cpu_loop_exec_tb(CPUState *cpu, TranslationBlock *tb,
> insns_left = MIN(0xffff, cpu->icount_budget);
> cpu_neg(cpu)->icount_decr.u16.low = insns_left;
> cpu->icount_extra = cpu->icount_budget - insns_left;
> - if (!cpu->icount_extra) {
> + if (!cpu->icount_extra && insns_left < tb->icount) {
> /* Execute any remaining instructions, then let the main loop
> * handle the next event.
> */
>
Queued, thanks.
Paolo
next prev parent reply other threads:[~2020-12-11 20:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-08 9:10 [PATCH] icount: improve exec nocache usage Pavel Dovgalyuk
2020-12-11 20:55 ` Paolo Bonzini [this message]
2020-12-11 21:41 ` Richard Henderson
2020-12-12 6:22 ` Pavel Dovgalyuk
2020-12-12 14:31 ` Richard Henderson
2020-12-14 6:33 ` Pavel Dovgalyuk
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=a019bf2e-c20e-3465-42de-44a8271d5828@redhat.com \
--to=pbonzini@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=pavel.dovgalyuk@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).