qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Luca Tettamanti <kronos.it@gmail.com>
Cc: kvm-devel@lists.sf.net, qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [kvm-devel] [PATCH 0/4] Rework alarm timer infrastrucure -	take2
Date: Wed, 22 Aug 2007 08:02:07 +0300	[thread overview]
Message-ID: <46CBC34F.6060601@qumranet.com> (raw)
In-Reply-To: <20070821193834.GB13544@dreamland.darkstar.lan>

Luca Tettamanti wrote:

> Actually I'm having troubles with cyclesoak (probably it's calibration),
> numbers are not very stable across multiple runs...
>   

I've had good results with cyclesoak; maybe you need to run it in
runlevel 3 so the load generated by moving the mouse or breathing
doesn't affect meaurements.

> I've also tried APC which was suggested by malc[1] and:
> - readings are far more stable
> - the gap between dynticks and non-dynticks seems not significant
>
>   
>> Can you verify this by running
>>
>>    strace -c -p `pgrep qemu` & sleep 10; pkill strace
>>
>> for all 4 cases, and posting the results?
>>     
>
> Plain QEMU:
>
> With dynticks:
>
> % time     seconds  usecs/call     calls    errors syscall
> ------ ----------- ----------- --------- --------- ----------------
>  57.97    0.000469           0     13795           clock_gettime
>  32.88    0.000266           0      1350           gettimeofday
>   7.42    0.000060           0      1423      1072 sigreturn
>   1.73    0.000014           0      5049           timer_gettime
>   0.00    0.000000           0      1683      1072 select
>   0.00    0.000000           0      2978           timer_settime
> ------ ----------- ----------- --------- --------- ----------------
> 100.00    0.000809                 26278      2144 total
>   

The 1072 select() errors are the delivered ticks (EINTR).  But why only
1000?  would have expected 10000 for a 1000Hz guest in a 10 sec period.

> HPET:
>
> % time     seconds  usecs/call     calls    errors syscall
> ------ ----------- ----------- --------- --------- ----------------
>  87.48    0.010459           1     10381     10050 select
>   8.45    0.001010           0     40736           clock_gettime
>   2.73    0.000326           0     10049           gettimeofday
>   1.35    0.000161           0     10086     10064 sigreturn
> ------ ----------- ----------- --------- --------- ----------------
> 100.00    0.011956                 71252     20114 total
>   

This is expected.  1 tick per millisecond.

> Unix (SIGALRM):
>
> % time     seconds  usecs/call     calls    errors syscall
> ------ ----------- ----------- --------- --------- ----------------
>  90.36    0.011663           1     10291      9959 select
>   7.38    0.000953           0     40355           clock_gettime
>   2.05    0.000264           0      9960           gettimeofday
>   0.21    0.000027           0      9985      9969 sigreturn
> ------ ----------- ----------- --------- --------- ----------------
> 100.00    0.012907                 70591     19928 total
>   

Same here.

> And KVM:
>
> dynticks:
>
> % time     seconds  usecs/call     calls    errors syscall
> ------ ----------- ----------- --------- --------- ----------------
>  78.90    0.004001           1      6681      5088 rt_sigtimedwait
>  10.87    0.000551           0     27901           clock_gettime
>   4.93    0.000250           0      7622           timer_settime
>   4.30    0.000218           0     10078           timer_gettime
>   0.39    0.000020           0      3863           gettimeofday
>   0.35    0.000018           0      6054           ioctl
>   0.26    0.000013           0      4196           select
>   0.00    0.000000           0      1593           rt_sigaction
> ------ ----------- ----------- --------- --------- ----------------
> 100.00    0.005071                 67988      5088 total
>   

kvm uses sigtimedwait() to wait for signals.  Here, an error (ETIMEDOUT)
indicates we did _not_ get a wakeup, so there are 1500 wakeups in a 10
second period.  Strange.  Some calibration error?

> HPET:
>
> % time     seconds  usecs/call     calls    errors syscall
> ------ ----------- ----------- --------- --------- ----------------
>  90.20    0.011029           0     32437     22244 rt_sigtimedwait
>   4.46    0.000545           0     44164           clock_gettime
>   2.59    0.000317           0     12128           gettimeofday
>   1.50    0.000184           0     10193           rt_sigaction
>   1.10    0.000134           0     12461           select
>   0.15    0.000018           0      6060           ioctl
> ------ ----------- ----------- --------- --------- ----------------
> 100.00    0.012227                117443     22244 total
>   

10K wakeups per second.  The code is not particularly efficient (11
syscalls per tick), but overhead is still low.

> Unix:
>
> % time     seconds  usecs/call     calls    errors syscall
> ------ ----------- ----------- --------- --------- ----------------
>  83.29    0.012522           0     31652     21709 rt_sigtimedwait
>   6.91    0.001039           0     43125           clock_gettime
>   3.50    0.000526           0      6042           ioctl
>   2.74    0.000412           0      9943           rt_sigaction
>   1.98    0.000298           0     12183           select
>   1.58    0.000238           0     11850           gettimeofday
> ------ ----------- ----------- --------- --------- ----------------
> 100.00    0.015035                114795     21709 total
>   

Same thing.

> The guest is an idle kernel with HZ=1000.
>   

Can you double check this?  The dyntick results show that this is either
a 100Hz kernel, or that there is a serious bug in dynticks.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.

  parent reply	other threads:[~2007-08-22  5:02 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-17 23:11 [Qemu-devel] [PATCH 0/4] Rework alarm timer infrastrucure - take 2 Luca Tettamanti
2007-08-17 23:11 ` [Qemu-devel] [PATCH 1/4] Rework alarm timer infrastrucure Luca Tettamanti
2007-08-17 23:11 ` [Qemu-devel] [PATCH 2/4] Add -clock option Luca Tettamanti
2007-08-17 23:11 ` [Qemu-devel] [PATCH 3/4] Add support for HPET periodic timer Luca Tettamanti
2007-08-21 19:24   ` Matthew Kent
2007-08-21 19:40     ` Luca
2007-08-21 20:15       ` Matthew Kent
2007-08-22  6:48         ` [kvm-devel] " Dan Kenigsberg
2007-08-22  7:03           ` Avi Kivity
2007-08-22 12:34             ` Andi Kleen
2007-08-22 21:11               ` Dan Kenigsberg
2007-08-22 22:09                 ` Andi Kleen
2007-08-23  7:02                   ` Dan Kenigsberg
2007-08-24 20:18                     ` Luca
2007-08-25  8:24                       ` Dan Kenigsberg
2007-09-03  8:40       ` GUERRAZ Francois
2007-08-17 23:11 ` [Qemu-devel] [PATCH 4/4] Add support for dynamic ticks Luca Tettamanti
2007-08-17 23:48 ` [Qemu-devel] [PATCH 0/4] Rework alarm timer infrastrucure - take 2 Christian MICHON
2007-08-18  0:10   ` [kvm-devel] " Luca
2007-08-18 15:17 ` [Qemu-devel] Re: [kvm-devel] " Anthony Liguori
2007-08-18 16:53   ` [Qemu-devel] RE: [kvm-devel] [PATCH 0/4] Rework alarm timer infrastrucure - take2 Dor Laor
2007-08-18 22:02     ` [Qemu-devel] " Luca Tettamanti
2007-08-18 23:58       ` Anthony Liguori
2007-08-19  7:36         ` [Qemu-devel] RE: [kvm-devel] [PATCH 0/4] Rework alarm timer infrastrucure -take2 Dor Laor
2007-08-19  8:24         ` [Qemu-devel] Re: [kvm-devel] [PATCH 0/4] Rework alarm timer infrastrucure - take2 Avi Kivity
2007-08-19 13:10           ` Jamie Lokier
2007-08-19 13:48             ` [kvm-devel] [Qemu-devel] " Avi Kivity
2007-08-19 13:57               ` Paul Brook
2007-08-19 14:07                 ` Avi Kivity
2007-08-19 14:27                   ` Dor Laor
2007-08-20  9:25                   ` Avi Kivity
2007-08-19 17:15                 ` Jamie Lokier
2007-08-19 19:29                   ` [kvm-devel] [Qemu-devel] Re: [PATCH 0/4] Rework alarmtimer " Dor Laor
2007-08-19 19:30                   ` [kvm-devel] [Qemu-devel] Re: [PATCH 0/4] Rework alarm timer " Avi Kivity
2007-08-19 16:52       ` [Qemu-devel] Re: [kvm-devel] " Luca
2007-08-19 19:31         ` Avi Kivity
2007-08-20 21:20           ` Luca Tettamanti
2007-08-20 21:55             ` malc
2007-08-20 22:49               ` [kvm-devel] [Qemu-devel] " Luca
2007-08-21 12:09             ` [Qemu-devel] Re: [kvm-devel] " Avi Kivity
2007-08-21 19:38               ` Luca Tettamanti
2007-08-21 19:44                 ` malc
2007-08-22  5:02                 ` Avi Kivity [this message]
2007-08-22 16:12                   ` Luca Tettamanti
2007-08-22 16:21                     ` Avi Kivity
2007-08-22 16:38                       ` Luca
2007-08-22 16:45                         ` Avi Kivity
2007-08-22 17:23                           ` Luca
2007-08-22 17:39                             ` Luca
2007-08-22 19:21                             ` Luca
2007-08-22 21:35                               ` [Qemu-devel] " Dor Laor
2007-08-22 22:07                                 ` [Qemu-devel] " Luca
2007-08-22 20:42                         ` Dan Kenigsberg

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=46CBC34F.6060601@qumranet.com \
    --to=avi@qumranet.com \
    --cc=kronos.it@gmail.com \
    --cc=kvm-devel@lists.sf.net \
    --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).