All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Evanzhang <Evanzhang@archeros.com>
Cc: qemu-devel@nongnu.org, pbonzini@redhat.com
Subject: Re: [PATCH v1] rtc/mc146818rtc: improve rtc performance
Date: Mon, 25 Sep 2023 17:33:00 -0400	[thread overview]
Message-ID: <20230925173144-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <4490419ebd87e46adf2294f62c5f3808d2467e40.1690188072.git.Evanzhang@archeros.com>

On Mon, Jul 24, 2023 at 04:54:22PM +0800, Evanzhang wrote:
> under heavy workloads,irq_coalesced could up to 30+,
> after modification EXTERNAL_INTERRUPT reduce by 40%
> 
> before:
> Analyze events for all VMs, all VCPUs:
>              VM-EXIT    Samples  Samples%     Time%
> 
>        EPT_VIOLATION    9833984    63.41%    15.96%
>       IO_INSTRUCTION    2160843    13.93%    50.07%
>   EXTERNAL_INTERRUPT    1949267    12.57%     0.89%
>           APIC_WRITE     767795     4.95%     0.55%
>          EOI_INDUCED     615308     3.97%     0.30%
>                  HLT     130821     0.84%    31.77%
> 
> after:
> Analyze events for all VMs, all VCPUs:
>              VM-EXIT    Samples  Samples%     Time%
> 
>        EPT_VIOLATION    5238031    50.91%     6.44%
>       IO_INSTRUCTION    2257658    21.94%    54.88%
>   EXTERNAL_INTERRUPT    1160086    11.28%     0.61%
>           APIC_WRITE     780454     7.59%     0.54%
>          EOI_INDUCED     615309     5.98%     0.28%
>                  HLT     179703     1.75%    36.87%
> 
> Signed-off-by: Evanzhang <Evanzhang@archeros.com>



Paolo do you mind picking this old patch up?

Reviewed-by: Michael S. Tsirkin <mst@redhat.com>

> ---
>  hw/rtc/mc146818rtc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
> index c27c362..2995078 100644
> --- a/hw/rtc/mc146818rtc.c
> +++ b/hw/rtc/mc146818rtc.c
> @@ -96,8 +96,8 @@ static void rtc_coalesced_timer_update(MC146818RtcState *s)
>      if (s->irq_coalesced == 0) {
>          timer_del(s->coalesced_timer);
>      } else {
> -        /* divide each RTC interval to 2 - 8 smaller intervals */
> -        int c = MIN(s->irq_coalesced, 7) + 1;
> +        /* divide each RTC interval to 2 - 32 smaller intervals */
> +        int c = MIN(s->irq_coalesced, 31) + 1;
>          int64_t next_clock = qemu_clock_get_ns(rtc_clock) +
>              periodic_clock_to_ns(s->period / c);
>          timer_mod(s->coalesced_timer, next_clock);
> -- 
> 2.9.5



      reply	other threads:[~2023-09-25 21:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-24  8:54 [PATCH v1] rtc/mc146818rtc: improve rtc performance Evanzhang
2023-07-24  8:54 ` Evanzhang
2023-09-25 21:33   ` Michael S. Tsirkin [this message]

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=20230925173144-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=Evanzhang@archeros.com \
    --cc=pbonzini@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.