From: Peter Maydell <peter.maydell@linaro.org>
To: Xin Tong <xerox.time.tech@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] interrupt handling in qemu
Date: Tue, 27 Dec 2011 23:36:57 +0000 [thread overview]
Message-ID: <CAFEAcA-zK4beRwoQLzh6Ves6pSbrPSoR-fiBON_V__npvxBDyw@mail.gmail.com> (raw)
In-Reply-To: <CALKntY1LimQ5Kim=OTC3POy1ycDvS6nMHsEsz9XpzLZHOYHKEA@mail.gmail.com>
On 27 December 2011 23:12, Xin Tong <xerox.time.tech@gmail.com> wrote:
> The reason I ask is that I am searching for alternatives to QEMU
> current way of handling interrupt (unlink translation blocks on
> interrupt). However, an obvious approach - checking for interrupt in
> every basic block, seems to be too heavy ( too many tb enters/exits
> ).
It's not awful -- an extra load-test-branch-not-taken per
TB, which IIRC from last time I tried to measure it was ~3%
speed penalty, obv. very variable with what the guest code is.
I have a half-finished patch for this but since I don't have a
decent benchmarking setup I've never got round to submitting it.
> Maybe checking interrupt in a few basic blocks might be better, but
> what is a good measure for the number of basic blocks to execute
> before checking for interrupt ?
The trouble is that you can't tell when you're translating the
TB whether it's just one in a sequence A->B->C (where you could
perhaps skip the check at the start of B), or if you're
actually looking at a tight loop B->B (or B->C->B). So you don't
have the information conveniently to hand to tell you whether
you can skip compiling the interrupt check into this TB.
(One heuristic for how often we need to check would be "every
N instructions, or at every backwards branch or indirect-branch",
but this doesn't fit with the idea of putting the checks at the
start of the TB, they'd have to go in the middle of the TB which
is probably awkward.)
-- PMM
next prev parent reply other threads:[~2011-12-27 23:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-27 23:12 [Qemu-devel] interrupt handling in qemu Xin Tong
2011-12-27 23:36 ` Peter Maydell [this message]
2011-12-28 0:43 ` Xin Tong
2011-12-28 1:10 ` Peter Maydell
2011-12-28 1:23 ` Xin Tong
2011-12-28 21:10 ` Peter Maydell
2011-12-29 0:48 ` Xin Tong
2011-12-29 1:31 ` Peter Maydell
2011-12-28 10:42 ` Avi Kivity
2011-12-28 11:40 ` Peter Maydell
2011-12-28 12:04 ` Avi Kivity
2011-12-28 17:00 ` Xin Tong
2011-12-28 19:07 ` Lluís Vilanova
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=CAFEAcA-zK4beRwoQLzh6Ves6pSbrPSoR-fiBON_V__npvxBDyw@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=xerox.time.tech@gmail.com \
/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).