From: Avi Kivity <avi@redhat.com>
To: Peter Portante <peter.portante@redhat.com>
Cc: qemu-devel@nongnu.org, Peter Portante <pportant@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] Small change to remove short 250us timeouts every other time through the wait loop.
Date: Tue, 27 Mar 2012 14:34:07 +0200 [thread overview]
Message-ID: <4F71B3BF.2060301@redhat.com> (raw)
In-Reply-To: <1332428393-4203-1-git-send-email-peter.portante@redhat.com>
On 03/22/2012 04:59 PM, Peter Portante wrote:
> Basically, the main wait loop calls qemu_run_all_timers() unconditionally. The
> first thing this routine used to do is to see if a timer had been serviced,
> and then reset the loop timeout to the next deadline.
>
> However, the new deadlines had not been calculated at that point, as
> qemu_run_timers() had not been called yet for each of the clocks. So
> qemu_rearm_alarm_timer() would end up with a negative or zero deadline, and
> default to setting a 250us timeout for the loop.
>
> As qemu_run_timers() is called for each clock, the real deadlines would be put
> in place, but because a loop timeout was already set, the loop timeout would
> not be changed.
>
> Once that 250us timeout fired, the real deadline would be used for the
> subsequent timeout.
>
> For idle VMs, this effectively doubles the number of times through the loop,
> doubling the number of select() system calls, timer calls, etc. putting added
> scheduling pressure on the kernel. And under cgroups, this really causes a big
> problem because the cgroup code does not scale well.
>
> By simply running the timers before trying to rearm the timer, we always rearm
> with a non-zero deadline, effectively halving the number of system calls.
Reviewed-by: Avi Kivity <avi@redhat.com>
Note the canonical subject line for patches is "subsystem: short
description", in this case something like "qemu-timer: remove spurious
host alarm wakeups" would be a good fit.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-03-27 12:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-22 14:59 [Qemu-devel] [PATCH] Small change to remove short 250us timeouts every other time through the wait loop Peter Portante
2012-03-27 12:34 ` Avi Kivity [this message]
2012-03-27 13:14 ` Peter Portante
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=4F71B3BF.2060301@redhat.com \
--to=avi@redhat.com \
--cc=peter.portante@redhat.com \
--cc=pportant@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).