From: Thomas Gleixner <tglx@linutronix.de>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Virtualization Mailing List <virtualization@lists.osdl.org>,
john stultz <johnstul@us.ibm.com>,
LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
akpm@linux-foundation.org
Subject: Re: + stupid-hack-to-make-mainline-build.patch added to -mm tree
Date: Wed, 07 Mar 2007 22:40:39 +0100 [thread overview]
Message-ID: <1173303639.24738.814.camel@localhost.localdomain> (raw)
In-Reply-To: <45EF2991.1020204@goop.org>
On Wed, 2007-03-07 at 13:07 -0800, Jeremy Fitzhardinge wrote:
> Thomas Gleixner wrote:
> > I tend to disagree. The clockevents infrastructure was designed to cope
> > with the existing mess of real hardware. The discussion over the last
> > days exposed me to even more exotic designs than the hardware vendors
> > were able to deliver until now.
> >
>
> It's a different but related problem domain. It's also an increasingly
> common execution environment for a kernel to find itself in. Dealing
> with proper paravirtualized timer devices is a big improvement over
> trying to reliably deal with fully virtualized hardware timers, which
> simply can't make the same guarantees that real hardware can make - such
> as "you will definitely get N ns of CPU time between doing the
> delta->absolute computation and programming the match register".
That's exactly the reason why we want only _ONE_ proper virtualized
timer device instead of 10 new variants of broken hardware.
> > I know exactly where you are heading:
> >
> > Offload the handling of hypervisor design decisions to the kernel and
> > let us deal with that. So we need to implement 128 bit math to convert
> > back and forth and I expect more interesting things to creep up.
> >
>
> I wouldn't put it that way. We've been getting a lot of pressure to
> keep the pv_ops interface as small as possible. Reusing existing kernel
> interfaces rather than making up new ones is a good way to do that. The
> clock infrastructure certainly cleans things up; earlier Xen patches
> made a complete copy of the old kernel/time.c and hacked it around,
> which isn't what anyone wants to do.
All you need is exactly ONE paravirt clockevent device and ONE paravirt
clocksource for _ALL_ hypervisors. Cast that into stone with a
paravirt_ops->clockwahtever interface and we are all happy.
> > All this is of _NO_ use and benefit for the kernel itself.
> >
>
> Lots of people want to run Linux in virtual machines. If we can make
> sane kernel changes to help those users, then that is of use an benefit
> to the kernel.
The above will give a real benefit as it is a well defined interface,
which can be verified on both ends.
> > Real hardware copes well with relative deltas for the events, even when
> > it is match register based. I thought long about the support for
> > absolute expiry values in cycles and decided against them to avoid that
> > math hackery, which you folks now demand.
> >
>
> Not really. Xen and VMI interfaces both use absolute monotonic time for
> timeouts, which is certainly a common case for such interfaces
> (pthread_cond_timedwait, for example). Converting delta to absolute is
> clearly simple, but it does introduce an added bit of non-determinism if
> your CPU can be preempted from outside at any time. I presume SMM or
> similar interrupts can cause the same problem on real hardware.
As I said before: I have no objection against expanding / changing the
clockevents interface to deliver absolute expiry time, which we have
already handy.
I just refuse for a good reason to convert it from ktime_t (nanoseconds)
to an absolute cycle value. This can be done on the hypervisor side of
the paravirt clock event device. Same applies for clocksources. The ones
which need nanosecond from/to whatever conversion can do it _IN_ the
hypervisor and not in 10 different grades of madness in the kernel code.
> > We can optimize this by skipping the conversion via a feature flag.
> The clocksource needed the shift for ntp warping. Does the clockevent
> need a shift at all? Could I just set mult/shift to 1/0?
Yes.
> > Your implementation is almost the perfect prototype, if you move the
> > 128 bit hackery into the hypervisor and hide it away from the kernel :)
> >
> The point is to use the tsc to avoid making any hypercalls, so dealing
> with the tsc->ns conversion has to happen on the guest side somehow.
I understand that you want to make this as fast as possible, but TSC is
broken in more than one way and it just makes me barf, when we have yet
another way of dealing with it in the kernel.
Please keep the paravirt interface abstract and treat it in the same way
we treat the kernel - userspace API. The kernel hides all this hardware
crap away from the user space and the same applies for a sane paravirt
interface. This is also a benefit in terms of portability.
For devices, which already live on top of an abstraction layer in the
kernel, e.g. clocksources, clockevents, interrupts, we can share one
implementation accross multiple platforms.
> > One of these is perfectly fine for _ALL_ of the hypervisor folks.
> > Anything else is just a backwards decision for the kernel.
> >
> That would certainly be ideal. We'll look at the xen, vmi, lguest and
> kvm paravirtualized time models and see how much they really have in
> common. I'm a bit curious about how vmi's time events make their way
> back into the system.
By the crude mechanism I'm fighting.
tglx
next prev parent reply other threads:[~2007-03-07 21:40 UTC|newest]
Thread overview: 105+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200703060654.l266sVxr014860@shell0.pdx.osdl.net>
[not found] ` <45ED16D2.3000202@vmware.com>
[not found] ` <20070306084258.GA15745@elte.hu>
[not found] ` <20070306084647.GA16280@elte.hu>
2007-03-06 8:55 ` + stupid-hack-to-make-mainline-build.patch added to -mm tree Zachary Amsden
2007-03-06 10:59 ` Thomas Gleixner
2007-03-06 21:07 ` Dan Hecht
2007-03-06 22:21 ` Andi Kleen
2007-03-06 21:32 ` Dan Hecht
2007-03-06 23:53 ` Thomas Gleixner
2007-03-07 0:24 ` Jeremy Fitzhardinge
2007-03-07 0:35 ` Dan Hecht
2007-03-07 0:49 ` Thomas Gleixner
2007-03-07 0:53 ` Dan Hecht
2007-03-07 1:18 ` Thomas Gleixner
2007-03-07 2:08 ` Dan Hecht
2007-03-07 8:37 ` Thomas Gleixner
2007-03-07 17:41 ` Jeremy Fitzhardinge
2007-03-07 17:49 ` Ingo Molnar
2007-03-07 18:03 ` James Morris
2007-03-07 18:35 ` Jeremy Fitzhardinge
2007-03-08 0:45 ` Alan Cox
2007-03-07 17:52 ` Ingo Molnar
2007-03-07 18:28 ` Jeremy Fitzhardinge
2007-03-07 18:53 ` Thomas Gleixner
2007-03-07 18:11 ` James Morris
2007-03-07 18:56 ` Thomas Gleixner
2007-03-07 19:05 ` Jeremy Fitzhardinge
2007-03-07 19:49 ` Dan Hecht
2007-03-07 20:11 ` Jeremy Fitzhardinge
2007-03-07 20:49 ` Dan Hecht
2007-03-07 21:14 ` Thomas Gleixner
2007-03-07 20:57 ` Thomas Gleixner
2007-03-07 21:02 ` Dan Hecht
2007-03-07 21:08 ` Jeremy Fitzhardinge
2007-03-07 21:19 ` Thomas Gleixner
2007-03-07 21:14 ` Dan Hecht
2007-03-07 21:21 ` Thomas Gleixner
2007-03-07 21:33 ` Dan Hecht
2007-03-07 22:05 ` Jeremy Fitzhardinge
2007-03-07 23:05 ` Thomas Gleixner
2007-03-07 23:25 ` Zachary Amsden
2007-03-07 23:36 ` Jeremy Fitzhardinge
2007-03-07 23:40 ` Zachary Amsden
2007-03-08 18:30 ` Chris Wright
2007-03-08 0:22 ` Thomas Gleixner
2007-03-08 1:01 ` Daniel Arai
2007-03-08 1:23 ` Jeremy Fitzhardinge
2007-03-08 7:02 ` Thomas Gleixner
2007-03-08 7:28 ` Thomas Gleixner
2007-03-08 8:01 ` Zachary Amsden
2007-03-08 18:24 ` Chris Wright
2007-03-08 18:44 ` Daniel Arai
2007-03-08 19:14 ` Chris Wright
2007-03-08 19:17 ` Ingo Molnar
2007-03-08 19:42 ` Jeremy Fitzhardinge
2007-03-08 19:47 ` Chris Wright
2007-03-08 19:52 ` Jeremy Fitzhardinge
2007-03-08 20:10 ` Chris Wright
2007-03-08 20:18 ` Jeremy Fitzhardinge
2007-03-08 20:23 ` Chris Wright
2007-03-08 20:33 ` Jeremy Fitzhardinge
2007-03-08 20:42 ` Chris Wright
2007-03-08 20:42 ` Jeremy Fitzhardinge
2007-03-08 21:45 ` Andi Kleen
2007-03-08 19:54 ` Ingo Molnar
[not found] ` <20070308091019.GA19460@elte.hu>
2007-03-08 10:06 ` hardwired VMI crap Zachary Amsden
2007-03-08 11:09 ` Thomas Gleixner
2007-03-08 20:46 ` Zachary Amsden
2007-03-08 21:15 ` Jeremy Fitzhardinge
2007-03-08 21:34 ` Ingo Molnar
2007-03-08 21:43 ` Andi Kleen
2007-03-08 23:39 ` Jeremy Fitzhardinge
2007-03-08 23:55 ` Zachary Amsden
2007-03-09 0:10 ` Jeremy Fitzhardinge
2007-03-09 0:29 ` Linus Torvalds
2007-03-09 0:22 ` Daniel Walker
2007-03-09 0:28 ` Thomas Gleixner
2007-03-09 0:04 ` Thomas Gleixner
2007-03-09 0:44 ` Jeremy Fitzhardinge
2007-03-08 22:31 ` Zachary Amsden
2007-03-08 21:39 ` Andi Kleen
2007-03-08 22:58 ` Zachary Amsden
2007-03-08 18:35 ` Chris Wright
2007-03-07 23:33 ` + stupid-hack-to-make-mainline-build.patch added to -mm tree Jeremy Fitzhardinge
2007-03-07 23:52 ` Dan Hecht
2007-03-08 0:19 ` Jeremy Fitzhardinge
2007-03-08 0:35 ` Thomas Gleixner
2007-03-08 0:38 ` Jeremy Fitzhardinge
2007-03-07 20:40 ` Thomas Gleixner
2007-03-07 21:07 ` Jeremy Fitzhardinge
2007-03-07 21:40 ` Thomas Gleixner [this message]
2007-03-07 21:34 ` Dan Hecht
2007-03-07 22:14 ` Thomas Gleixner
2007-03-07 22:17 ` Zachary Amsden
2007-03-07 22:31 ` Thomas Gleixner
2007-03-07 22:28 ` Dan Hecht
2007-03-08 8:01 ` Ingo Molnar
2007-03-08 8:15 ` Keir Fraser
2007-03-08 8:41 ` Jeremy Fitzhardinge
2007-03-08 10:26 ` Rusty Russell
2007-03-07 21:42 ` Dan Hecht
2007-03-07 22:07 ` Thomas Gleixner
2007-03-07 5:10 ` Jeremy Fitzhardinge
2007-03-07 0:40 ` Thomas Gleixner
2007-03-07 0:42 ` Dan Hecht
2007-03-07 1:22 ` Thomas Gleixner
2007-03-07 1:44 ` Dan Hecht
2007-03-07 7:48 ` Thomas Gleixner
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=1173303639.24738.814.camel@localhost.localdomain \
--to=tglx@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=jeremy@goop.org \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=virtualization@lists.osdl.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).