From: Sheng Yang <sheng@linux.intel.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org, Alexander Graf <agraf@suse.de>,
avi@redhat.com, Kevin Wolf <kwolf@suse.de>
Subject: Re: [PATCH] Fix almost infinite loop in APIC
Date: Wed, 21 Jan 2009 10:40:49 +0800 [thread overview]
Message-ID: <200901211040.49733.sheng@linux.intel.com> (raw)
In-Reply-To: <20090120185139.GA28746@amt.cnet>
On Wednesday 21 January 2009 02:51:39 Marcelo Tosatti wrote:
> Hi Sheng,
>
> On Tue, Jan 20, 2009 at 09:43:15PM +0800, Sheng Yang wrote:
> > Marcelo, I realize some interesting things.
> >
> > In fact, on my machine, when I measured the delta of now() and
> > last_update at kvm_apic_timer_intr_post(), the delta was bigger and
> > bigger...(and now() is always bigger for me, so still no clue for why
> > data can be like above, last_update always ahead of when for about one
> > period...).
> >
> > Then I found something not good in original design - it ignored the
> > interval between time fire and injection, so we got:
> >
> > last_update = now() + n * period;
> >
> > And the time we update last_update:
> >
> > time = now() + n * period + n * interval.
> >
> > So last_update time is more and more inaccurate... Though it was revised
> > by tmcct function, it's still not a good way to go.
> >
> > Then I understand your purpose more.
> >
> > + if (unlikely(atomic_read(&apic->timer.pending) > 0)) {
> > + remaining = apic->timer.injection_delay;
> > + if (ktime_to_ns(remaining) > apic->timer.period)
> > + remaining = ns_to_ktime(apic->timer.period);
> > + } else
> > + remaining = hrtimer_expires_remaining(&apic->timer.dev);
> >
> > And about your patch, how about take interval between intr_post() and
> > read tmcct in to account as well?
>
> You mean to sum up interval between intr_post() and read tmcct into
> injection_delay?
>
> I don't get it. Can you be more descriptive please?
Mind continue to change...
A: time_fire
B: intr_post
C: read TMCCT
I think the sequence can be AABC or AACB(I just consider AABC last night...).
We have determined to return A->C as TMCCT, and the interval between different
A is period which can be ignored. So how about simply return
hrtimer_expires_remaining() for all tmcct reading including pending ones?
(And sorry for I still can't get why you return injection delay for TMCCT...)
--
regards
Yang, Sheng
next prev parent reply other threads:[~2009-01-21 2:40 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-08 16:36 [PATCH] Fix almost infinite loop in APIC Alexander Graf
2009-01-09 6:34 ` Sheng Yang
2009-01-09 10:49 ` Alexander Graf
2009-01-09 12:57 ` Alexander Graf
2009-01-10 11:21 ` Sheng Yang
2009-01-11 4:55 ` Marcelo Tosatti
2009-01-13 7:47 ` Sheng Yang
2009-01-13 22:01 ` Marcelo Tosatti
2009-01-14 9:17 ` Sheng Yang
2009-01-14 17:03 ` Marcelo Tosatti
2009-01-15 7:20 ` Sheng Yang
2009-01-16 5:01 ` Marcelo Tosatti
2009-01-20 10:41 ` Alexander Graf
2009-01-20 11:20 ` Sheng Yang
2009-01-20 12:09 ` Alexander Graf
2009-01-20 12:30 ` Sheng Yang
2009-01-20 13:43 ` Sheng Yang
2009-01-20 18:51 ` Marcelo Tosatti
2009-01-21 2:40 ` Sheng Yang [this message]
2009-01-21 4:23 ` Marcelo Tosatti
2009-01-21 5:11 ` Sheng Yang
2009-01-21 15:07 ` Marcelo Tosatti
2009-01-21 16:01 ` Alexander Graf
2009-01-21 16:03 ` Alexander Graf
2009-01-21 16:18 ` Alexander Graf
2009-01-21 16:55 ` Marcelo Tosatti
2009-01-22 13:08 ` Avi Kivity
2009-01-23 17:58 ` Alex Williamson
2009-01-10 11:25 ` Sheng Yang
2009-01-10 11:28 ` Sheng Yang
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=200901211040.49733.sheng@linux.intel.com \
--to=sheng@linux.intel.com \
--cc=agraf@suse.de \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kwolf@suse.de \
--cc=mtosatti@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox