All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Avi Kivity <avi@redhat.com>, qemu-devel <qemu-devel@nongnu.org>,
	Glauber Costa <glommer@redhat.com>,
	Ulrich Obergfell <uobergfe@redhat.com>, kvm <kvm@vger.kernel.org>
Subject: Re: [Qemu-devel] Re: [RFC: 0/2] patch for QEMU HPET periodic timer emulation to alleviate time drift
Date: Mon, 07 Feb 2011 15:10:03 +0100	[thread overview]
Message-ID: <4D4FFD3B.2030903@siemens.com> (raw)
In-Reply-To: <4D4FF24A.7000004@codemonkey.ws>

On 2011-02-07 14:23, Anthony Liguori wrote:
> On 02/07/2011 07:14 AM, Avi Kivity wrote:
>> On 02/07/2011 03:11 PM, Anthony Liguori wrote:
>>> On 02/07/2011 06:34 AM, Avi Kivity wrote:
>>>> On 02/04/2011 10:56 AM, Jan Kiszka wrote:
>>>>> >
>>>>> >  This should be a rare event.  If you are missing 50% of your
>>>>> >  notifications, not amount of gradual catchup is going to help
>>>>> you out.
>>>>>
>>>>> But that's the only thing this patch is after: lost ticks at QEMU
>>>>> level.
>>>>
>>>> Most lost ticks will happen at the vcpu level.  The iothread has low
>>>> utilization and will therefore be scheduled promptly, whereas the
>>>> vcpu thread may have high utilization and will thus be preempted. 
>>>> When it is preempted for longer than the timer tick, we will see
>>>> vcpu-level coalescing.  All it takes is 2:1 overcommit to see time
>>>> go half as fast; I don't think you'll ever see that on bare metal.
>>>
>>> But that's not to say that doing something about lost ticks in QEMU
>>> isn't still useful.
>>>
>>
>> If it doesn't solve the majority of the problems it isn't very useful
>> IMO.  It's a good first step, but not sufficient for real world use
>> with overcommit.
> 
> Even if we have a way to detect coalescing, we still need to make sure
> we don't lose ticks in QEMU.  So regardless of whether it solves the
> majority of problems, we need this anyway.

Again: please not in an ad-hoc fashion but as a generic services usable
by _all_ periodic timer sources that want to implement compensation.
This infrastructure should also be designed to once integrate IRQ
coalescing information as well.

The point why I'm insisting on a broader solution is that both sources
for lost ticks (iothread and vcpu) end up in the same output: an
adjustment of the injection frequency of the affected timer device.
There is not "HPET" or "RTC" or "PIT" in this, all this may apply to the
SoC timer of some emulated ARM board as well.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

WARNING: multiple messages have this Message-ID (diff)
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Ulrich Obergfell <uobergfe@redhat.com>,
	Glauber Costa <glommer@redhat.com>, Avi Kivity <avi@redhat.com>,
	kvm <kvm@vger.kernel.org>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Re: [RFC: 0/2] patch for QEMU HPET periodic timer emulation to alleviate time drift
Date: Mon, 07 Feb 2011 15:10:03 +0100	[thread overview]
Message-ID: <4D4FFD3B.2030903@siemens.com> (raw)
In-Reply-To: <4D4FF24A.7000004@codemonkey.ws>

On 2011-02-07 14:23, Anthony Liguori wrote:
> On 02/07/2011 07:14 AM, Avi Kivity wrote:
>> On 02/07/2011 03:11 PM, Anthony Liguori wrote:
>>> On 02/07/2011 06:34 AM, Avi Kivity wrote:
>>>> On 02/04/2011 10:56 AM, Jan Kiszka wrote:
>>>>> >
>>>>> >  This should be a rare event.  If you are missing 50% of your
>>>>> >  notifications, not amount of gradual catchup is going to help
>>>>> you out.
>>>>>
>>>>> But that's the only thing this patch is after: lost ticks at QEMU
>>>>> level.
>>>>
>>>> Most lost ticks will happen at the vcpu level.  The iothread has low
>>>> utilization and will therefore be scheduled promptly, whereas the
>>>> vcpu thread may have high utilization and will thus be preempted. 
>>>> When it is preempted for longer than the timer tick, we will see
>>>> vcpu-level coalescing.  All it takes is 2:1 overcommit to see time
>>>> go half as fast; I don't think you'll ever see that on bare metal.
>>>
>>> But that's not to say that doing something about lost ticks in QEMU
>>> isn't still useful.
>>>
>>
>> If it doesn't solve the majority of the problems it isn't very useful
>> IMO.  It's a good first step, but not sufficient for real world use
>> with overcommit.
> 
> Even if we have a way to detect coalescing, we still need to make sure
> we don't lose ticks in QEMU.  So regardless of whether it solves the
> majority of problems, we need this anyway.

Again: please not in an ad-hoc fashion but as a generic services usable
by _all_ periodic timer sources that want to implement compensation.
This infrastructure should also be designed to once integrate IRQ
coalescing information as well.

The point why I'm insisting on a broader solution is that both sources
for lost ticks (iothread and vcpu) end up in the same output: an
adjustment of the injection frequency of the affected timer device.
There is not "HPET" or "RTC" or "PIT" in this, all this may apply to the
SoC timer of some emulated ARM board as well.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

  parent reply	other threads:[~2011-02-07 14:10 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <480481933.225059.1296734409954.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com>
2011-02-03 13:43 ` [RFC: 0/2] patch for QEMU HPET periodic timer emulation to alleviate time drift Ulrich Obergfell
2011-02-03 15:28   ` Jan Kiszka
2011-02-03 15:28     ` [Qemu-devel] " Jan Kiszka
2011-02-03 20:07     ` Anthony Liguori
2011-02-03 20:07       ` Anthony Liguori
2011-02-03 21:24       ` Jan Kiszka
2011-02-03 21:24         ` Jan Kiszka
2011-02-04  2:06         ` Anthony Liguori
2011-02-04  2:06           ` Anthony Liguori
2011-02-04  8:56           ` Jan Kiszka
2011-02-04  8:56             ` Jan Kiszka
2011-02-07 12:34             ` Avi Kivity
2011-02-07 12:34               ` Avi Kivity
2011-02-07 13:11               ` Anthony Liguori
2011-02-07 13:11                 ` Anthony Liguori
2011-02-07 13:14                 ` Avi Kivity
2011-02-07 13:14                   ` Avi Kivity
2011-02-07 13:23                   ` Anthony Liguori
2011-02-07 13:23                     ` Anthony Liguori
2011-02-07 13:34                     ` Avi Kivity
2011-02-07 13:34                       ` Avi Kivity
2011-02-07 13:41                     ` Gleb Natapov
2011-02-07 13:41                       ` Gleb Natapov
2011-02-07 13:46                       ` Avi Kivity
2011-02-07 13:46                         ` Avi Kivity
2011-02-07 13:48                         ` Gleb Natapov
2011-02-07 13:48                           ` Gleb Natapov
2011-02-07 13:51                           ` Avi Kivity
2011-02-07 13:51                             ` Avi Kivity
2011-02-07 13:54                             ` Gleb Natapov
2011-02-07 13:54                               ` Gleb Natapov
2011-02-07 14:10                     ` Jan Kiszka [this message]
2011-02-07 14:10                       ` Jan Kiszka
2011-02-07 14:28                       ` Anthony Liguori
2011-02-07 14:28                         ` Anthony Liguori
2011-02-07 14:43                         ` Jan Kiszka
2011-02-07 14:43                           ` Jan Kiszka
2011-02-07 14:54                           ` Anthony Liguori
2011-02-07 14:54                             ` Anthony Liguori
2011-02-07 14:57                             ` Jan Kiszka
2011-02-07 14:57                               ` Jan Kiszka
2011-02-07 15:01                               ` Anthony Liguori
2011-02-07 15:01                                 ` Anthony Liguori
2011-02-07 15:08                                 ` Jan Kiszka
2011-02-07 15:08                                   ` Jan Kiszka
2011-02-07 15:13                                 ` Avi Kivity
2011-02-07 15:13                                   ` Avi Kivity
2011-02-07 15:17                                   ` Jan Kiszka
2011-02-07 15:17                                     ` Jan Kiszka
2011-02-07 15:29                                     ` Avi Kivity
2011-02-07 15:29                                       ` Avi Kivity
2011-02-07 19:30                                       ` Anthony Liguori
2011-02-07 19:30                                         ` Anthony Liguori
2011-02-08  9:11                                         ` Avi Kivity
2011-02-08  9:11                                           ` Avi Kivity
2011-02-07 15:20                                   ` Jan Kiszka
2011-02-07 15:20                                     ` Jan Kiszka
2011-02-07 15:30                                     ` Avi Kivity
2011-02-07 15:30                                       ` Avi Kivity
2011-02-07 19:28                                     ` Anthony Liguori
2011-02-07 19:28                                       ` Anthony Liguori
2011-02-07 14:58                             ` Avi Kivity
2011-02-07 14:58                               ` Avi Kivity
2011-02-07 15:01                               ` Jan Kiszka
2011-02-07 15:01                                 ` Jan Kiszka
2011-02-07 15:08                                 ` Avi Kivity
2011-02-07 15:08                                   ` Avi Kivity
2011-02-07 15:14                                   ` Jan Kiszka
2011-02-07 15:14                                     ` Jan Kiszka
2011-02-07 15:16                                     ` Avi Kivity
2011-02-07 15:16                                       ` Avi Kivity
2011-02-07 15:22                                   ` Anthony Liguori
2011-02-07 15:22                                     ` Anthony Liguori
2011-02-07 15:18                               ` Anthony Liguori
2011-02-04  9:52           ` Ulrich Obergfell
2011-02-04  9:52             ` Ulrich Obergfell
2011-02-07 10:44       ` Ulrich Obergfell
2011-02-07 10:44         ` Ulrich Obergfell
2011-02-07 13:24       ` Anthony Liguori
2011-02-07 13:24         ` Anthony Liguori

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=4D4FFD3B.2030903@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=glommer@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=uobergfe@redhat.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 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.