From: Gleb Natapov <gleb@redhat.com>
To: andrzej zaborowski <balrogg@gmail.com>
Cc: dlaor@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RESEND][PATCH 0/3] Fix guest time drift under heavy load.
Date: Sat, 8 Nov 2008 10:23:16 +0200 [thread overview]
Message-ID: <20081108082316.GA19381@redhat.com> (raw)
In-Reply-To: <fb249edb0811071518x1277c010hb748a8a696167a49@mail.gmail.com>
On Sat, Nov 08, 2008 at 12:18:00AM +0100, andrzej zaborowski wrote:
> 2008/11/6 Gleb Natapov <gleb@redhat.com>:
> >> >> >> This doesn't matter, the tick that arrived while a previous interrupt
> >> >> >> was not acked yet, is lost anyway,
> >> >> > Not it is not. Not necessary. It can be queued inside PIC and delivered
> >> >> > by PIC itself immediately after interrupt acknowledgement.
> >> >>
> >> >> You can argue that it's the new irq that's lost or it's the first one
> >> >> that was lost, either way the PIC only sees one time the irq rising,
> >> >> instead of two. That means they were coalesced.
> >> > Nothing is lost and PIC sees two irq rising. Example:
> >> > - RTC triggers first interrupt.
> >> > - It is delivered to PIC. PIC sets corespondent bit in IRR.
> >> > - CPU picks up RTC interrupt and it's bit is cleared from IRR bitmap.
> >> > - CPU jumps to RTC IRQ routing but before it gets a chance to acknowledge
> >> > IRQ to PIC new timer is triggered.
> >> > - With your patch you increment irq_coalesced in that case.
> >> > - Interrupt is delivered to PIC.
> >>
> >> No, it isn't (unless the PIC is poorly implemented). We raise the
> >> irq, but since it's already high, nothing happens, there's no rising
> >> edge.
> >>
> > That would be the case if RTC used level triggered interrupts, but
> > RTC and PIT are edge-trigered. That is how they behave like it or not.
>
> Sorry, I'm not taking this at all. If this was the case it would be
> completely broken, but I just had a look at i8259 and the
> implementation seems to be correct.
>
> The two devices are connected with only one line. The signal on the
> line can be in one of two states (levels). After the first tick it
> becomes high. It stays high until a read to RTC_REG_C clears it. The
> second call to qemu_irq_raise does not change the level, there's no
> edge. If there's no event, how possibly can there be a reaction?
>
Yes, I was wrong about how RTC behaves. I described how PIT works. PIT
generates square wave and does not wait for acknowledgement from an OS.
For RTC you suggestion will mostly work and will needlessly re-inject
only those ticks that were generated when RTC interrupt vector was masked.
Don't know how often this happens in reality.
--
Gleb.
next prev parent reply other threads:[~2008-11-08 8:23 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-29 15:22 [Qemu-devel] [RESEND][PATCH 0/3] Fix guest time drift under heavy load Gleb Natapov
2008-10-29 15:22 ` [Qemu-devel] [PATCH 1/3] Change qemu_set_irq() to return status information Gleb Natapov
2008-10-29 15:22 ` [Qemu-devel] [PATCH 2/3] Fix time drift problem under high load when PIT is in use Gleb Natapov
2008-10-29 15:22 ` [Qemu-devel] [PATCH 3/3] Fix time drift problem under high load when RTC " Gleb Natapov
2008-11-05 12:46 ` Dor Laor
2008-10-31 19:17 ` [Qemu-devel] [RESEND][PATCH 0/3] Fix guest time drift under heavy load Anthony Liguori
2008-11-02 13:04 ` Gleb Natapov
2008-11-05 12:45 ` Dor Laor
2008-11-05 15:48 ` andrzej zaborowski
2008-11-05 16:33 ` Anthony Liguori
2008-11-06 7:16 ` Gleb Natapov
2008-11-06 9:37 ` andrzej zaborowski
2008-11-06 10:08 ` Gleb Natapov
2008-11-06 13:21 ` andrzej zaborowski
2008-11-06 14:18 ` Gleb Natapov
2008-11-06 14:35 ` andrzej zaborowski
2008-11-06 15:04 ` Gleb Natapov
2008-11-06 15:41 ` Anthony Liguori
2008-11-07 23:18 ` andrzej zaborowski
2008-11-08 8:23 ` Gleb Natapov [this message]
2008-11-06 13:44 ` Paul Brook
2008-11-05 17:43 ` Gleb Natapov
2008-11-06 17:28 ` David S. Ahern
2008-11-05 16:43 ` Anthony Liguori
2008-11-06 3:55 ` Jamie Lokier
2008-11-06 8:12 ` Gleb Natapov
2008-11-06 14:10 ` Anthony Liguori
2008-11-06 14:24 ` Paul Brook
2008-11-06 14:40 ` Anthony Liguori
2008-11-06 14:51 ` Gleb Natapov
2008-11-06 15:37 ` Anthony Liguori
2008-11-08 8:36 ` Gleb Natapov
2008-11-08 22:14 ` Dor Laor
2008-11-09 7:40 ` Gleb Natapov
2008-11-09 16:38 ` Anthony Liguori
2008-11-09 21:00 ` Avi Kivity
2008-11-09 16:36 ` Anthony Liguori
2008-11-10 14:37 ` Gleb Natapov
2008-11-10 15:24 ` Anthony Liguori
2008-11-10 15:29 ` Gleb Natapov
2008-11-10 15:46 ` Anthony Liguori
2008-11-10 15:51 ` Gleb Natapov
2008-11-11 14:43 ` Gleb Natapov
2008-11-11 17:26 ` Anthony Liguori
2008-11-11 20:17 ` Anthony Liguori
2008-11-12 11:42 ` Gleb Natapov
2008-11-12 11:54 ` Glauber Costa
2008-11-12 12:38 ` Dor Laor
2008-11-06 3:41 ` Jamie Lokier
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=20081108082316.GA19381@redhat.com \
--to=gleb@redhat.com \
--cc=balrogg@gmail.com \
--cc=dlaor@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 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).