qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Stefan Weil <weil@mail.berlios.de>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [RFC][PATCH] qemu-timer: Run timers in alarm timer handler
Date: Thu, 23 Aug 2012 15:11:37 +0200	[thread overview]
Message-ID: <50362C09.60508@redhat.com> (raw)
In-Reply-To: <503629A8.4070501@siemens.com>

Il 23/08/2012 15:01, Jan Kiszka ha scritto:
> On 2012-08-23 14:24, Paolo Bonzini wrote:
>> Il 23/08/2012 14:10, Jan Kiszka ha scritto:
>>>> Can you expand on this?
>>>
>>> Well, this patch removes an indirection from timer event deliveries. So
>>> it reduces overhead, though only noticeable if you have high-rate timers.
>>
>> Actually, timers (and bottom halves) are always run after iohandlers.
>> So the qemu_notify_event should already be completely useless for Unix,
>> even if we leave the host_alarm_handler indirection.
> 
> Is there anything that requires this ordering for timers?

No, I don't think so.  (And also not for bottom halves, since those
always do a qemu_notify_event).

>> But this leaves out Windows, where your next task of (IIUC) having
>> multiple instances of struct qemu_alarm_timer would be complicated by
>> the qemu_notify_event.  I guess this is the original reason for your patch.
> 
> I'm not heading for multi-instance alarm timers or any kind of
> optimization on Windows. It should just continue to work. Windows is
> neither a high-performance nor a real-time platform for QEMU, IMHO.

Yeah, making multi-instance alarm timers optional does it as well.  (As
long as it doesn't bit rot).

>> So, in order to remove the qemu_notify_event completely, what about not
>> using signals anymore for timers?  You could just tweak the select
>> timeout and drop all the -clock madness.  Zero syscalls, practically no
>> overhead.  If this is not precise enough, use timerfd on Linux only
> 
> Need to think about it. At least, real-time tasks will get proper
> precision on Linux. Not sure if it will be sufficient on other hosts.

Do we care (I put non-Linux POSIX just a little above Windows but not much)?

>> (BTW, switching to an absolute deadline would be useful too).
> 
> Why? We aren't affected by clock adjustment with relative timeouts.

Just the usual fact that the deadline is incorrect if QEMU is pre-empted
between computing the deadline and applying it.  It shouldn't really
matter for the iothread, because it's not CPU bound, but it's cleaner
since internally we store absolute deadlines anyway.

Paolo

  reply	other threads:[~2012-08-23 13:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-23 11:23 [Qemu-devel] [RFC][PATCH] qemu-timer: Run timers in alarm timer handler Jan Kiszka
2012-08-23 11:39 ` Paolo Bonzini
2012-08-23 12:10   ` Jan Kiszka
2012-08-23 12:24     ` Paolo Bonzini
2012-08-23 13:01       ` Jan Kiszka
2012-08-23 13:11         ` Paolo Bonzini [this message]
2012-08-23 18:09           ` Jan Kiszka
2012-08-24  7:45             ` Paolo Bonzini

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=50362C09.60508@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=qemu-devel@nongnu.org \
    --cc=weil@mail.berlios.de \
    /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).