Re: [PATCH v1 2/2] USB: set hub's default autosuspend delay as 0

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

 



On Tue, Sep 25, 2012 at 3:26 AM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
>
> By how much?  That is, how many times is an unbound USB device going to
> be autosuspended?

I mean if we can remove the timer for the unbound devices, why not do it
to decrease wakeup counts for CPU?

In fact, the CPU should be busy(udev things, related application, ...) during
driver unbind, so kind of msleep() inside auto-suspend path may not cause
extra CPU wakeup if the timer is disabled.

But, 2 seconds later, CPU may become idle, so the autosuspend may
introduce some extra wakeups.

>
> Do you have any particular use cases in mind where the extra CPU power
> usage will matter?

Not, just try to decrease unnecessary cpu wakeup by disabling the
autosuspend timer for unbound devices.

>
>> > aren't too many things you can do with an unbound device; lsusb is one
>> > of the most common.
>>
>> Considered 'lsusb' is a low frequency tool for final users, so could we just
>> ignore it for the case?
>
> It depends on the case.  What sort of device do you have in mind?

I mean for final users, 'lsusb' will be seldom used.  Also, non-hub devices
should be woke up only one time by 'lsusb -v' no matter the autosuspend
delay change.

>
>> > On the other hand, we already have a usbcore module parameter for
>> > specifying the default autosuspend delay.  That's what the delay is set
>> > to when a device is first initialized, before it is bound to anything.
>> > Unfortunately the parameter's value is in seconds, not milliseconds, so
>> > we can't set it to any positive value smaller than 1 second.
>>
>> It is a global and can't be used to just change on unbound device.
>
> That's right; it affects every device.
>
> But think of it this way: Suppose there's no driver for a particular
> device.  Its autosuspend delay will get set to the default initially
> and then there won't be any driver to change it.  So when would the
> delay be changed to 0?

How about just keeping the default delay for this device?

>
> I'm not sure that this is something the kernel needs to worry about.
> Userspace can easily set the default delay to 0 whenever it wants to.
> This won't affect devices that are already plugged in... but userspace
> can also set the delays for those devices whenever it wants to.

If we can do it in kernel safely and consistently, looks not necessary to
bother userspace.

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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux