qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: QEMU Developers <qemu-devel@nongnu.org>
Cc: Bharat Bhushan <bharat.bhushan@freescale.com>,
	"qemu-ppc@nongnu.org list:PowerPC" <qemu-ppc@nongnu.org>,
	Fabien Chouteau <chouteau@adacore.com>
Subject: [Qemu-devel] [PATCH 2/2] PPC: BookE: Make FIT/WDT timers at best microsecond grained
Date: Sat, 23 Nov 2013 04:53:41 +0100	[thread overview]
Message-ID: <1385178821-1891-3-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1385178821-1891-1-git-send-email-agraf@suse.de>

The default granularity for the FIT timer on 440 is on every 0x1000th
transition of TB from 0 to 1. Translated that means 48828 times a second.

Since interrupts are quite expensive for 440 and we don't really care
about the accuracy of the FIT to that significance, let's force FIT and
WDT to at best microsecond granularity.

This basically restores behavior as it was in QEMU 1.6, where timers
could only deal with microsecond granularities at all.

This patch greatly improves performance with the 440 target and restores
roughly the same performance level that QEMU 1.6 had for me.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/ppc/ppc_booke.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/ppc/ppc_booke.c b/hw/ppc/ppc_booke.c
index 28cf9fd..3038acc 100644
--- a/hw/ppc/ppc_booke.c
+++ b/hw/ppc/ppc_booke.c
@@ -174,6 +174,12 @@ static void booke_update_fixed_timer(CPUPPCState         *env,
 
     if (*next == now) {
         (*next)++;
+    } else {
+        /*
+         * There's no point to fake any granularity that's more fine grained
+         * than microseconds. Anything beyond that just overloads the system.
+         */
+        *next = MAX(*next, now + SCALE_MS);
     }
 
     /* Fire the next timer */
-- 
1.7.12.4

  parent reply	other threads:[~2013-11-23  3:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-23  3:53 [Qemu-devel] [PATCH 1.7 0/2] PPC: Fix BookE timer performance regression Alexander Graf
2013-11-23  3:53 ` [Qemu-devel] [PATCH 1/2] PPC: Make BookE FIT/WDT timers more lazy Alexander Graf
2013-11-23  3:53 ` Alexander Graf [this message]
2013-11-23  4:08 ` [Qemu-devel] [PATCH 1.7 0/2] PPC: Fix BookE timer performance regression Stefan Weil
2013-11-23  4:43   ` Stefan Weil
2013-11-25 11:10   ` Alexander Graf

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=1385178821-1891-3-git-send-email-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=bharat.bhushan@freescale.com \
    --cc=chouteau@adacore.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).