qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Alberto Garcia <berto@igalia.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] throttle: Check current timers before updating any_timer_armed[]
Date: Tue, 16 Jun 2015 10:53:09 +0100	[thread overview]
Message-ID: <20150616095309.GG22299@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1434382875-3998-1-git-send-email-berto@igalia.com>

[-- Attachment #1: Type: text/plain, Size: 1119 bytes --]

On Mon, Jun 15, 2015 at 06:41:15PM +0300, Alberto Garcia wrote:
> Calling throttle_group_config() cancels all timers from a particular
> BlockDriverState, so any_timer_armed[] should be updated accordingly.
> 
> However, with the current code it may happen that a timer is armed in
> a different BlockDriverState from the same group, so any_timer_armed[]
> would be set to false in a situation where there is still a timer
> armed.
> 
> The consequence is that we might end up with two timers armed. This
> should not have any noticeable impact however, since all accesses to
> the ThrottleGroup are protected by a lock, and the situation would
> become normal again shortly thereafter as soon as all timers have been
> fired.
> 
> The correct way to solve this is to check that we're actually
> cancelling a timer before updating any_timer_armed[].
> 
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
>  block/throttle-groups.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

      reply	other threads:[~2015-06-16  9:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-15 15:41 [Qemu-devel] [PATCH] throttle: Check current timers before updating any_timer_armed[] Alberto Garcia
2015-06-16  9:53 ` Stefan Hajnoczi [this message]

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=20150616095309.GG22299@stefanha-thinkpad.redhat.com \
    --to=stefanha@redhat.com \
    --cc=berto@igalia.com \
    --cc=qemu-block@nongnu.org \
    --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).