From: Hans de Goede <hdegoede@redhat.com>
To: luo_brian <luo_brian@126.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Performance of usb tablet over ehci
Date: Tue, 11 Dec 2012 23:40:11 +0100 [thread overview]
Message-ID: <50C7B64B.1010301@redhat.com> (raw)
In-Reply-To: <3e1838e9.148d6.13b8b801db6.Coremail.luo_brian@126.com>
Hi,
On 12/11/2012 08:45 PM, luo_brian wrote:
> I just noticed a patch recently submitted to qemu, attempting to lower the cpu load for idle vm using usb tablet emulation.
>
> This is the comment of commit 427e3aa151c749225364d0c30640e2e3c1756d9d:
>
> usb-tablet: Allow connecting to ehci
>
> Our ehci code has is capable of significantly lowering the wakeup rate
> for the hcd emulation while the device is idle. It is possible to add
> similar code ot the uhci emulation, but that simply is not there atm,
> and there is no reason why a (virtual) usb-tablet can not be a USB-2 device.
>
> Making usb-hid devices connect to the emulated ehci controller instead
> of the emulated uhci controller on vms which have both lowers the cpuload
> for a fully idle vm from 20% to 2-3% (on my laptop).
>
> An alternative implementation to using a property to select the tablet
> type, would be simply making it a new device type, ie usb-table! t2, but the
> downside of that is that this will require libvirt changes to be available
> through libvirt at all, and then management tools changes to become the
> default for new vms, where as using a property will automatically get
> any pc-1.3 type vms the lower cpuload.
>
> I tried to connect usb tablet to ehci by libvirt, which automatically generted qemu command as follows. However, the cpuload of idle vm is still much higher than PS2 mouse emulation on my laptop. (usb-tablet: 30-35%, usb-tablet2: 16-19%, PS2 mouse: 9-10%). Is there something wrong with my configuration?
Given that the cpu-load with the usb-tablet almost halved I think the patches
are working as intended and your config is ok :)
My tests were run with a Linux guest (with the udev rule for enabling usb
remote wakeup disabled), it is possible that Windows uses the HID idle report
feature which would still cause some wakeups. Also note that if you actually
move the mouse over the vm window this will temporarily increase the
wakeup rate too.
In the end the problem stays that usb uses a polling model versus the
async interrupt model ps2 uses.
Regards,
Hans
next prev parent reply other threads:[~2012-12-11 22:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-11 19:45 [Qemu-devel] Performance of usb tablet over ehci luo_brian
2012-12-11 22:40 ` Hans de Goede [this message]
2012-12-12 8:29 ` Gerd Hoffmann
2012-12-13 15:25 ` luo_brian
2012-12-13 15:32 ` Gerd Hoffmann
2012-12-19 17:48 ` Hao Luo
2012-12-20 6:54 ` Gerd Hoffmann
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=50C7B64B.1010301@redhat.com \
--to=hdegoede@redhat.com \
--cc=luo_brian@126.com \
--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).