[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC V2 6/8] throttle: Add a way to fire one of the timers
From: |
Benoît Canet |
Subject: |
[Qemu-devel] [RFC V2 6/8] throttle: Add a way to fire one of the timers asap like a bottom half |
Date: |
Wed, 13 Aug 2014 16:23:57 +0200 |
This will be needed by the group throttling algorithm.
Signed-off-by: Benoit Canet <address@hidden>
---
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.0.rc1
- [Qemu-devel] [RFC V2 0/8] Throttle group cooperative round robin scheduling, Benoît Canet, 2014/08/14
- [Qemu-devel] [RFC V2 2/8] throttle: Add throttle group infrastructure, Benoît Canet, 2014/08/14
- [Qemu-devel] [RFC V2 4/8] throttle: Prepare to have multiple timers for one ThrottleState, Benoît Canet, 2014/08/14
- [Qemu-devel] [RFC V2 1/8] throttle: Extract timers from ThrottleState into a separate ThrottleTimers structure, Benoît Canet, 2014/08/14
- [Qemu-devel] [RFC V2 8/8] throttle: Update throttle infrastructure copyright, Benoît Canet, 2014/08/14
- [Qemu-devel] [RFC V2 5/8] throttle: Add a way to know if throttle_schedule_timer had armed a timer, Benoît Canet, 2014/08/14
- [Qemu-devel] [RFC V2 6/8] throttle: Add a way to fire one of the timers asap like a bottom half,
Benoît Canet <=
- [Qemu-devel] [RFC V2 3/8] throttle: Add throttle group infrastructure tests, Benoît Canet, 2014/08/14
- [Qemu-devel] [RFC V2 7/8] throttle: Add throttle group support, Benoît Canet, 2014/08/14
- Re: [Qemu-devel] [RFC V2 0/8] Throttle group cooperative round robin scheduling, Benoît Canet, 2014/08/20