Bug 663064 - usb autosuspend configuration should be persistent
usb autosuspend configuration should be persistent
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: udev (Show other bugs)
6.0
Unspecified Unspecified
low Severity medium
: rc
: 6.1
Assigned To: Harald Hoyer
qe-baseos-daemons
:
Depends On: 632299
Blocks: Rhel6KvmTier1
  Show dependency treegraph
 
Reported: 2010-12-14 10:30 EST by Glauber Costa
Modified: 2013-01-09 18:25 EST (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
This release of udev turns on the autosuspend feature of the qemu virtual mouse, tablet and keyboard devices to reduce load on virtual machines.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-05-19 07:50:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
udev patch (2.83 KB, patch)
2011-01-25 05:51 EST, Gerd Hoffmann
no flags Details | Diff

  None (edit)
Description Glauber Costa 2010-12-14 10:30:13 EST
Description of problem:

In order to reduce idle load of USB devices running on emulated USB buses (mostly virtualization environments), we want the autosuspend feature of USB devices enabled whereas possible.

The sysfs representation of the device, however, won't enable it automatically, nor persist the current value upon reboots.

It would be nice that we could add a udev rule that could enable idle virtualization guests to reduce their load without the need for manual interaction by the sysadmin.
Comment 2 Gerd Hoffmann 2010-12-14 11:29:47 EST
> > I'm using this in my testing:
> > 
> > [root@fedora64 ~]# cat /lib/udev/usb_autosuspend
> > #!/bin/sh
> > path="$1"
> > if test -f "/sys${path}/power/control"; then
> > 	echo "auto" > "/sys${path}/power/control"
> > elif test -f "/sys${path}/power/level"; then
> > 	echo "auto" > "/sys${path}/power/level"
> > fi
> > [root@fedora64 ~]# cat /lib/udev/rules.d/99-qemu.rules
> > ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Tablet", 
> > RUN+="usb_autosuspend %p"
> > 
> > The tricky part here is to figure whenever remote wakeup is going to 
> > work or not.  The emulated HID devices in current qemu advertise remote 
> > wakeup support but they don't actually support it ...
> > 
> > cheers,
> >    Gerd
> > 
Let's add it all to https://bugzilla.redhat.com/show_bug.cgi?id=663064

[x] done.
Comment 3 Phil Knirsch 2010-12-17 09:11:10 EST
That rule should be added to qemu though, like we do with all other application specific udev rules.

Reassigning to qemu.

Thanks & regards, Phil
Comment 7 Gerd Hoffmann 2011-01-25 05:51:08 EST
Created attachment 475139 [details]
udev patch

Part one of the (host-side) patches is merged upstream now.
Part two (migration support) hopefully follows shortly.

Submitted patch for the guest-side config to udev upstream (see attachment).
Lets see how it goes.  When upstream accepts it we should backport it to our udev package.  Failing that we can stick the udev files into some guest agent package.
Comment 8 Harald Hoyer 2011-01-25 08:55:24 EST
I would suggest these rules as mentioned on the hotplug mailing list by Kay:

ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Mouse", ATTR{serial}=="42", TEST="power/control", ATTR{power/control}="auto"

ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Mouse", ATTR{serial}=="42", TEST="power/level", ATTR{power/level}="auto"

ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Tablet", ATTR{serial}=="42", TEST="power/control", ATTR{power/control}="auto"

ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Tablet", ATTR{serial}=="42", TEST="power/level", ATTR{power/level}="auto"

ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Keyboard", ATTR{serial}=="42", TEST="power/control", ATTR{power/control}="auto"

ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Keyboard", ATTR{serial}=="42", TEST="power/level", ATTR{power/level}="auto"


Do we need both variants for RHEL6.0?
Comment 9 Harald Hoyer 2011-01-25 08:56:01 EST
s/TEST=/TEST==/
Comment 10 Gerd Hoffmann 2011-01-25 09:34:49 EST
Wow, that is fast, I just finished reading that mail ;)

RHEL-6 has power/level only, power/control was added in more recent kernels.
Comment 12 Gerd Hoffmann 2011-01-25 10:52:32 EST
Reassigning to udev for backporting.
Comment 14 Harald Hoyer 2011-02-16 09:25:28 EST
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
This release of udev turns on the autosuspend feature of the qemu virtual mouse, tablet and keyboard devices to reduce load on virtual machines.
Comment 15 Karel Volný 2011-04-21 11:01:35 EDT
the rules got added:

# grep USB /lib/udev/rules.d/42-qemu-usb.rules
ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Mouse",    ATTR{serial}=="42", TEST=="power/level", ATTR{power/level}=="auto"
ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Tablet",   ATTR{serial}=="42", TEST=="power/level", ATTR{power/level}=="auto"
ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Keyboard", ATTR{serial}=="42", TEST=="power/level", ATTR{power/level}=="auto"
Comment 16 errata-xmlrpc 2011-05-19 07:50:38 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0525.html

Note You need to log in before you can comment on or make changes to this bug.