From: "Daniel P. Berrange" <berrange@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm-devel <kvm@vger.kernel.org>,
gcosta@redhat.com, kraxel@redhat.com, chrisw@redhat.com,
aliguori@us.ibm.com
Subject: Re: kvm guest loops_per_jiffy miscalibration under host load
Date: Mon, 7 Jul 2008 19:17:59 +0100 [thread overview]
Message-ID: <20080707181759.GA21554@redhat.com> (raw)
In-Reply-To: <20080702164021.GA31751@dmt.cnet>
On Wed, Jul 02, 2008 at 01:40:21PM -0300, Marcelo Tosatti wrote:
> I have been discussing with Glauber and Gerd the problem where KVM
> guests miscalibrate loops_per_jiffy if there's sufficient load on the
> host.
>
> calibrate_delay_direct() failed to get a good estimate for
> loops_per_jiffy.
> Probably due to long platform interrupts. Consider using "lpj=" boot
> option.
> Calibrating delay loop... <3>107.00 BogoMIPS (lpj=214016)
>
> While this particular host calculates lpj=1597041.
[snip]
> Possible solutions:
>
> - Require the admin to preset "lpj=". Nasty, not user friendly.
> - Pass the proper lpj value via a paravirt interface. Won't cover
> fullvirt guests.
> - Have the management app guarantee a minimum amount of CPU required
> for proper calibration during guest initialization.
I talked with Marcelo about this latter option - the idea being to have
libvirt do set_priority(PRIO_PROC, $pid, -20) on the KVM binary for
a short time at startup. The problem with this is that there's no
easy way to determine when, or for how long, to provide this priority
boost. During initial startup there is an arbitrary unknown delay
from the BIOS - 3 seconds to choose the boot device, a further 20-60
seconds if you choose PXE before the guest kernel is actually booted,
arbitrary delay if booting from CDROM and it has not auto boot timeout,
arbitrary user configurable delay in GRUB to choose kernel if booting
from harddisk.
So to stand any reasonable chance of working libvirt would have to give
the -20 priority boost for a good 60 seconds. If we want to start 2 or
more guests at once this soon stops being a viable workaround. And we
can't detect reboots triggered by the admin inside the guest. So I
don't see how we can reliably solve this from userspace management
tools, unless someone has better ideas than a priority boost for a short
while.
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
next prev parent reply other threads:[~2008-07-07 18:18 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-02 16:40 kvm guest loops_per_jiffy miscalibration under host load Marcelo Tosatti
2008-07-03 13:17 ` Glauber Costa
2008-07-04 22:51 ` Marcelo Tosatti
2008-07-07 1:56 ` Anthony Liguori
2008-07-07 18:27 ` Glauber Costa
2008-07-07 18:48 ` Marcelo Tosatti
2008-07-07 19:21 ` Anthony Liguori
2008-07-07 19:32 ` Glauber Costa
2008-07-07 21:35 ` Glauber Costa
2008-07-11 21:18 ` David S. Ahern
2008-07-12 14:10 ` Marcelo Tosatti
2008-07-12 19:28 ` David S. Ahern
2008-07-07 18:17 ` Daniel P. Berrange [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-07-22 3:25 Marcelo Tosatti
2008-07-22 8:22 ` Jan Kiszka
2008-07-22 12:49 ` Marcelo Tosatti
2008-07-22 15:54 ` Jan Kiszka
2008-07-22 22:00 ` Dor Laor
2008-07-22 19:56 ` David S. Ahern
2008-07-23 2:57 ` David S. Ahern
2008-07-29 14:58 ` Marcelo Tosatti
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=20080707181759.GA21554@redhat.com \
--to=berrange@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=chrisw@redhat.com \
--cc=gcosta@redhat.com \
--cc=kraxel@redhat.com \
--cc=kvm@vger.kernel.org \
--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