qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Benoît Canet" <benoit.canet@nodalink.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, famz@redhat.com,
	"Benoît Canet" <benoit.canet@nodalink.com>,
	stefanha@redhat.com
Subject: [Qemu-devel] [PATCH v1 6/8] throttle: Add a way to fire one of the timers asap like a bottom half
Date: Tue,  7 Oct 2014 15:24:37 +0200	[thread overview]
Message-ID: <1412688279-8312-7-git-send-email-benoit.canet@nodalink.com> (raw)
In-Reply-To: <1412688279-8312-1-git-send-email-benoit.canet@nodalink.com>

This will be needed by the group throttling algorithm.

Signed-off-by: Benoit Canet <benoit.canet@nodalink.com>
---
 include/qemu/throttle.h |  2 ++
 util/throttle.c         | 11 +++++++++++
 2 files changed, 13 insertions(+)

diff --git a/include/qemu/throttle.h b/include/qemu/throttle.h
index 3a16c48..3b9d1b8 100644
--- a/include/qemu/throttle.h
+++ b/include/qemu/throttle.h
@@ -127,6 +127,8 @@ bool throttle_schedule_timer(ThrottleState *ts,
                              bool is_write,
                              bool *armed);
 
+void throttle_fire_timer(ThrottleTimers *tt, bool is_write);
+
 void throttle_timer_fired(ThrottleState *ts, bool is_write);
 
 void throttle_account(ThrottleState *ts, bool is_write, uint64_t size);
diff --git a/util/throttle.c b/util/throttle.c
index a273acb..163b9d0 100644
--- a/util/throttle.c
+++ b/util/throttle.c
@@ -403,6 +403,17 @@ bool throttle_schedule_timer(ThrottleState *ts,
     return true;
 }
 
+/* Schedule a throttle timer like a BH
+ *
+ * @tt:       The timers structure
+ * @is_write: the type of operation (read/write)
+ */
+void throttle_fire_timer(ThrottleTimers *tt, bool is_write)
+{
+    int64_t now = qemu_clock_get_ns(tt->clock_type);
+    timer_mod(tt->timers[is_write], now + 1);
+}
+
 /* Remember that now timers are currently armed
  *
  * @ts:       the throttle state we are working on
-- 
2.1.1

  parent reply	other threads:[~2014-10-07 13:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-07 13:24 [Qemu-devel] [PATCH v1 0/8] Block Throttle Group Support Benoît Canet
2014-10-07 13:24 ` [Qemu-devel] [PATCH v1 1/8] throttle: Extract timers from ThrottleState into a separate ThrottleTimers structure Benoît Canet
2014-10-08  5:51   ` Fam Zheng
2014-10-08 15:06   ` Eric Blake
2014-10-07 13:24 ` [Qemu-devel] [PATCH v1 2/8] throttle: Add throttle group infrastructure Benoît Canet
2014-10-07 13:24 ` [Qemu-devel] [PATCH v1 3/8] throttle: Add throttle group infrastructure tests Benoît Canet
2014-10-08  6:20   ` Fam Zheng
2014-10-07 13:24 ` [Qemu-devel] [PATCH v1 4/8] throttle: Prepare to have multiple timers for one ThrottleState Benoît Canet
2014-10-07 13:24 ` [Qemu-devel] [PATCH v1 5/8] throttle: Add a way to know if throttle_schedule_timer had armed a timer Benoît Canet
2014-10-07 13:24 ` Benoît Canet [this message]
2014-10-08  6:26   ` [Qemu-devel] [PATCH v1 6/8] throttle: Add a way to fire one of the timers asap like a bottom half Fam Zheng
2014-10-07 13:24 ` [Qemu-devel] [PATCH v1 7/8] throttle: Add throttle group support Benoît Canet
2014-10-08  6:53   ` Fam Zheng
2014-10-08 11:05     ` Benoît Canet
2014-10-09  8:58       ` Fam Zheng
2014-10-10 11:35         ` Benoît Canet
2014-10-07 13:24 ` [Qemu-devel] [PATCH v1 8/8] throttle: Update throttle infrastructure copyright Benoît Canet

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=1412688279-8312-7-git-send-email-benoit.canet@nodalink.com \
    --to=benoit.canet@nodalink.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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;
as well as URLs for NNTP newsgroup(s).