[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/26] ehci: Further speedup rescanning if async sch
From: |
Hans de Goede |
Subject: |
[Qemu-devel] [PATCH 10/26] ehci: Further speedup rescanning if async schedule after raising an interrupt |
Date: |
Fri, 14 Dec 2012 14:35:31 +0100 |
I tried lowering the time between raising an interrupt and rescanning the
async schedule to see if the guest has queued a new transfer before, but
that did not have any positive effect. I now believe the cause for this is
that lowering this time made it more likely to hit the 1 ms interrupt
threshold penalty for the next packet, as described in my
"ehci: Use uframe precision for interrupt threshold checking" commit.
Now that we do interrupt threshold handling with uframe precision, futher
lowering this time from .5 to .25 ms gives an extra 15% improvement in speed
(MB/s) reading from a simple USB-2.0 thumb-drive.
While at it also properly set the int_req_by_async flag for short packet
completions.
Signed-off-by: Hans de Goede <address@hidden>
---
hw/usb/hcd-ehci.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index ef3ab97..c4d77bc 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -1341,6 +1341,9 @@ static void ehci_execute_complete(EHCIQueue *q)
if (tbytes) {
/* 4.15.1.2 must raise int on a short input packet */
ehci_raise_irq(q->ehci, USBSTS_INT);
+ if (q->async) {
+ q->ehci->int_req_by_async = true;
+ }
}
} else {
tbytes = 0;
@@ -2337,7 +2340,7 @@ static void ehci_frame_timer(void *opaque)
/* 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);
+ expire_time = t_now + get_ticks_per_sec() / (FRAME_TIMER_FREQ * 4);
ehci->int_req_by_async = false;
} else {
expire_time = t_now + (get_ticks_per_sec()
--
1.8.0.1
- [Qemu-devel] [PATCH 01/26] ehci: Add a ehci_writeback_async_complete_packet helper function, (continued)
- [Qemu-devel] [PATCH 01/26] ehci: Add a ehci_writeback_async_complete_packet helper function, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 02/26] ehci: Add ehci_verify_qh and ehci_verify_qtd helper functions, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 03/26] ehci: Verify guest does not change the token of inflight qtd-s, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 05/26] ehci: writeback_async_complete_packet: verify qh and qtd, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 06/26] ehci: Verify qtd for async completed packets, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 04/26] ehci: Move get / put_dwords upwards, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 08/26] ehci: Verify a queue's ep direction does not change, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 07/26] ehci: Add an ehci_get_pid helper function, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 09/26] ehci: Use uframe precision for interrupt threshold checking, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 12/26] uhci: Fix 1 ms delay in interrupt reporting to the guest, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 10/26] ehci: Further speedup rescanning if async schedule after raising an interrupt,
Hans de Goede <=
- [Qemu-devel] [PATCH 11/26] ehci: Don't call commit_irq after raising PCD, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 13/26] uhci: Fix pending interrupts getting lost on migration, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 14/26] uhci: Add a QH_VALID define, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 17/26] hid: Change idle handling to use a timer, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 15/26] uhci: Limit amount of frames processed in one go, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 20/26] usbredir: Add an usbredir_stop_ep helper function, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 19/26] usb: Add an usb_device_ep_stopped USBDevice method, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 16/26] uhci: Maximize how many frames we catch up when behind, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 21/26] usbredir: Add USBEP2I and I2USBEP helper macros, Hans de Goede, 2012/12/14
- [Qemu-devel] [PATCH 22/26] usbredir: Add ep_stopped USBDevice method, Hans de Goede, 2012/12/14