Re: high load with usb device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[linux-perf-users removed from Cc]

14.09.2010 15:02, Michael Tokarev wrote:
> 14.09.2010 14:39, Avi Kivity wrote:
>>  On 09/14/2010 12:25 PM, Michael Tokarev wrote:
>>> Not that it is much helpful either.  lsof:
>>>
>>> qemu-syst 23203  mjt    0u   CHR   136,9      0t0      12 /dev/pts/9
>>> qemu-syst 23203  mjt    1u   CHR   136,9      0t0      12 /dev/pts/9
>>> qemu-syst 23203  mjt    2u   CHR   136,9      0t0      12 /dev/pts/9
>>> qemu-syst 23203  mjt    3u   CHR  10,232      0t0    4402 /dev/kvm
>>> qemu-syst 23203  mjt    4u  0000     0,9        0     607 anon_inode
>>> qemu-syst 23203  mjt    5r  FIFO     0,8      0t0 8172675 pipe
>>> qemu-syst 23203  mjt    6w  FIFO     0,8      0t0 8172675 pipe
>>> qemu-syst 23203  mjt    7u   CHR  10,200      0t0    1228 /dev/net/tun
>>> qemu-syst 23203  mjt    8u  0000     0,9        0     607 anon_inode
>>> qemu-syst 23203  mjt    9u  IPv4 8173217      0t0     TCP *:5900 (LISTEN)
>>> qemu-syst 23203  mjt   10u  0000     0,9        0     607 anon_inode
>>> qemu-syst 23203  mjt   11u  0000     0,9        0     607 anon_inode
>>> qemu-syst 23203  mjt   12u  0000     0,9        0     607 anon_inode
>>
>>> So it is constantly poking fds# 11, 12, 10, 5&  6.
>>> 5 and 6 are pipe (selfpipe?),
>>
>> signalfd emulation, used to deliver signals efficiently.  Older glibc?
> 
> [e]glibc-2.11.
> 
> $ grep SIGNAL config-host.mak
> CONFIG_SIGNALFD=y
> 
> From strace of another run:
> 24318 signalfd(-1, [BUS ALRM IO], 8)    = 12
> (so one of the remaining fds is a signalfd :)
> 
>>> and 10..12 are "anon inode".
>>
>> Those are likely eventfds.
>>
>>> Here's the command line again:
>>>
>>> qemu-system-x86_64 \
>>>    -netdev type=tap,ifname=tap-kvm,id=x \
>>>    -device virtio-net-pci,netdev=x \
>>>    -monitor stdio \
>>>    -boot n \
>>>    -usbdevice tablet \
>>>    -m 1G \
>>>    -vnc :0
>>>
>>> Yes, it does quite a lot of timer stuff... ;)
>>
>> So timers internal to usb.
>>
>> Please try (independently):
>>
>> - just -usb, without -usbdevice tablet
> 
> No, that one works as expected - all quiet.
> -usbdevice tablet is also quiet up until
> guest loads usb host controller driver
> (not particular usb device driver).
> 
>> - instrument calls to qemu_mod_timer() in hw/usb-*hci.c.  Looks like
>> these are all 1kHz, but something else is clearly happening.

Ok. There's nothing interesting going on there either,
apparently.

It is using hw/usb-uhci.c.  I added a few prints() in there,
but they're firing at the defined 1KHz frequency.

Just for test, I lowered the frequency (FRAME_TIMER_FREQ)
from 1000 to 500, and the load dropped to half, from 19%
to 9..10%.

Looking at what hw/usb-uhci.c:uhci_frame_timer() routine
does, it is quite expected to have that many writes and
reads and that many gettimers().  It is polling for events
every 1/1000th of a second, instead of using some form of
select().

I'll do some more tests -- after all I'm curious why winXP
does not show this behavour.

Thanks!

/mjt
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux