All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Alex Bligh <alex@alex.org.uk>
Cc: Hans de Goede <hdegoede@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] main-loop: Don't lock starve io-threads when main_loop_tlg has pending events
Date: Wed, 09 Oct 2013 18:26:42 +0200	[thread overview]
Message-ID: <525583C2.2020504@redhat.com> (raw)
In-Reply-To: <65410BFC-E64A-47FD-AC5C-6B70F69E1D06@alex.org.uk>

Il 09/10/2013 18:19, Alex Bligh ha scritto:
>> Do you also agree that the equivalent workaround, before
>> > Alex's patch, was MIN_REARM_TIMER_NS (and thus 250 microseconds)?
> I don't think this was the case, as if it's a timer constantly
> expiring we'd have seen select() exit as soon as it was entered
> by the fd poked by the signal.

The signal itself was clamped to be at least 250 microseconds...

> That might be far more frequent.

... it's true though that it could have been less than 250 microseconds
(more precisely, 250 microseconds minus the time from qemu_mod_timer_ns
to select).

Since the CPU usage with Hans's patch is 100% and used to be 50%, it was
also more than 1 ns that Hans's patch is using.

> I think the equivalent would be something like: if the 'zero'
> timeout comes from the deadline calculation (and not
> nonblocking=true) then release the lock anyway. I think
> that would be a reasonable approach.
> 
> I would however like to get to the bottom of what's causing
> this as even pre my changes playing sound was apparently taking
> 50% CPU, which is not good. I am completely packed until the
> weekend but I propose producing a timer debug patch which
> will instrument what is expiring constantly (unless the
> problem with spice is obvious to someone).

I think Hans already debugged it to the (supposedly) 33 Hz timer that
spice audio uses.

If it turns out the bug is in the QEMU part of spice, I think it makes
sense _not_ to include this patch at all.

If it turns out to be in spice itself, then we can include it as a
workaround, but still it would be nice to tune a bit the limit and not
burn even more CPU time than before.

Paolo

  reply	other threads:[~2013-10-09 16:27 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-08 19:10 [Qemu-devel] [PATCH] main-loop: Don't lock starve io-threads when main_loop_tlg has pending events Hans de Goede
2013-10-08 19:13 ` Paolo Bonzini
2013-10-08 19:21   ` Hans de Goede
2013-10-08 19:33     ` Alex Bligh
2013-10-08 19:41       ` Hans de Goede
2013-10-08 20:01         ` Alex Bligh
2013-10-08 20:07           ` Alex Bligh
2013-10-08 20:16           ` Hans de Goede
2013-10-08 20:32             ` Alex Bligh
2013-10-08 20:50             ` Paolo Bonzini
2013-10-09 12:58               ` Hans de Goede
2013-10-09 13:18                 ` Alex Bligh
2013-10-09 18:03                   ` Hans de Goede
2013-10-09 18:15                     ` Hans de Goede
2013-10-09 18:28                     ` Alex Bligh
2013-10-09 18:36                       ` Alex Bligh
2013-10-09 18:49                         ` Hans de Goede
2013-10-09 19:03                           ` Paolo Bonzini
2013-10-09 19:15                             ` Hans de Goede
2013-10-09 14:37                 ` Paolo Bonzini
2013-10-09 16:19                   ` Alex Bligh
2013-10-09 16:26                     ` Paolo Bonzini [this message]
2013-10-09 16:33                       ` Alex Bligh
2013-10-09 17:53                       ` Hans de Goede
2013-10-09 18:09                   ` Hans de Goede
2013-10-08 19:48 ` Alex Bligh
2013-10-08 20:01   ` Hans de Goede
2013-10-08 21:25     ` Alex Bligh

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=525583C2.2020504@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex@alex.org.uk \
    --cc=hdegoede@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.