[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/36] ehci: Speed up the timer of raising int from
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 06/36] ehci: Speed up the timer of raising int from the async schedule |
Date: |
Thu, 25 Oct 2012 14:51:39 +0200 |
From: Hans de Goede <address@hidden>
Often the guest will queue up new packets in response to a packet, in the
async schedule with its IOC flag set, completing. By speeding up the
frame-timer, we notice these new packets earlier. This increases the
speed (MB/s) of a Linux guest reading from a USB mass storage device by a
factor of 1.15 on top of the "Improve latency of interrupt delivery"
speed-ups, both with and without input pipelining enabled.
I've not tested the speed-up of this patch without the
"Improve latency of interrupt delivery" patch.
Signed-off-by: Hans de Goede <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/hcd-ehci.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index f9ae05e..d600f08 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -443,6 +443,7 @@ struct EHCIState {
uint64_t last_run_ns;
uint32_t async_stepdown;
+ bool int_req_by_async;
};
#define SET_LAST_RUN_CLOCK(s) \
@@ -1529,6 +1530,9 @@ static void ehci_execute_complete(EHCIQueue *q)
if (q->qh.token & QTD_TOKEN_IOC) {
ehci_raise_irq(q->ehci, USBSTS_INT);
+ if (q->async) {
+ q->ehci->int_req_by_async = true;
+ }
}
}
@@ -2504,8 +2508,15 @@ static void ehci_frame_timer(void *opaque)
}
if (need_timer) {
- expire_time = t_now + (get_ticks_per_sec()
+ /* If we've raised int, we speed up the timer, so that we quickly
+ * notice any new packets queued up in response */
+ if (ehci->int_req_by_async && (ehci->usbsts & USBSTS_INT)) {
+ expire_time = t_now + get_ticks_per_sec() / (FRAME_TIMER_FREQ * 2);
+ ehci->int_req_by_async = false;
+ } else {
+ expire_time = t_now + (get_ticks_per_sec()
* (ehci->async_stepdown+1) / FRAME_TIMER_FREQ);
+ }
qemu_mod_timer(ehci->frame_timer, expire_time);
}
}
--
1.7.1
- [Qemu-devel] [PATCH 20/36] uhci: Move emptying of the queue's asyncs' queue to uhci_queue_free, (continued)
- [Qemu-devel] [PATCH 20/36] uhci: Move emptying of the queue's asyncs' queue to uhci_queue_free, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 33/36] xhci: flush endpoint context unconditinally, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 10/36] usb: Rename __usb_packet_complete to usb_packet_complete_one, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 03/36] ehci: Get rid of packet tbytes field, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 29/36] uhci: Always mark a queue valid when we encounter it, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 18/36] uhci: Don't retry on error, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 11/36] usb: Add USB_RET_ADD_TO_QUEUE packet result code, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 08/36] ehci: Retry to fill the queue while waiting for td completion, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 15/36] usb: Enforce iso endpoints never returing USB_RET_ASYNC, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 01/36] uhci: Properly unmap packets on cancel / invalid pid, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 06/36] ehci: Speed up the timer of raising int from the async schedule,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 32/36] xhci: fix function name in error message, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 12/36] usb: Move clearing of queue on halt to the core, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 16/36] uhci: No need to handle async completion of isoc packets, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 34/36] xhci: allow disabling interrupters, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 21/36] uhci: Rename UHCIAsync->td to UHCIAsync->td_addr, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 28/36] uhci: When the guest marks a pending td non-active, cancel the queue, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 27/36] uhci: Detect guest td re-use, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 13/36] usb: Move short-not-ok handling to the core, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 17/36] uhci: cleanup: Add an unlink call to uhci_async_cancel(), Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 25/36] uhci: Immediately free queues on device disconnect, Gerd Hoffmann, 2012/10/25