Bug 246341 - newhidups wakes up 1000 times per second
Summary: newhidups wakes up 1000 times per second
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: nut
Version: 7
Hardware: i386
OS: Linux
low
low
Target Milestone: ---
Assignee: Tomas Smetana
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: wakeup
TreeView+ depends on / blocked
 
Reported: 2007-06-30 18:16 UTC by Fabrice Bellet
Modified: 2008-01-25 11:01 UTC (History)
1 user (show)

Fixed In Version: 2.2.1-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-01-25 11:01:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Fabrice Bellet 2007-06-30 18:16:08 UTC
Under powertop, newhidups generates a large amount of wakeups/second:

Wakeups-from-idle per second : 2381.6
no ACPI power usage estimate available

Top causes for wakeups:
  65.9% (936.8)         newhidups : schedule_timeout (process_timeout) 
[...]

Here is a strace sample:

20:12:13 select(87, NULL, [], NULL, {0, 1000}) = 0 (Timeout)
20:12:13 gettimeofday({1183227133, 69667}, NULL) = 0
20:12:13 ioctl(86, USBDEVFS_REAPURBNDELAY, 0xbfaed4f8) = -1 EAGAIN (Resource
temporarily unavailable)
20:12:13 select(87, NULL, [], NULL, {0, 1000}) = 0 (Timeout)
20:12:13 gettimeofday({1183227133, 70666}, NULL) = 0
20:12:13 ioctl(86, USBDEVFS_REAPURBNDELAY, 0xbfaed4f8) = -1 EAGAIN (Resource
temporarily unavailable)
20:12:13 select(87, NULL, [], NULL, {0, 1000}) = 0 (Timeout)
20:12:13 gettimeofday({1183227133, 71692}, NULL) = 0
20:12:13 ioctl(86, USBDEVFS_REAPURBNDELAY, 0xbfaed4f8) = -1 EAGAIN (Resource
temporarily unavailable)
20:12:13 select(87, NULL, [], NULL, {0, 1000}) = 0 (Timeout)
20:12:13 gettimeofday({1183227133, 72667}, NULL) = 0
20:12:13 ioctl(86, USBDEVFS_REAPURBNDELAY, 0xbfaed4f8) = -1 EAGAIN (Resource
temporarily unavailable)
20:12:13 select(87, NULL, [], NULL, {0, 1000}) = 0 (Timeout)
20:12:13 gettimeofday({1183227133, 73745}, NULL) = 0
[...]

newhidups probably could be more resource-friendly.

Comment 1 Tomas Smetana 2007-11-28 13:59:42 UTC
I'm not sure that newhidups (or usbhid-ups in nut 2.2.0) could be more
resource-friendly...  They keep polling the ups for changes.  The polling
frequency is configurable (-i parameter) but setting it to high means that any
power-outage or other problem might be discovered too late and nut may not
initiate the shutdown in time.  I'll try to tweak the default frequency.

Comment 2 Fabrice Bellet 2008-01-24 22:40:10 UTC
rawhide version 2.2.1 lowered the timeout value from 5000 to 250, so usbhid-ups
now only generates ~100 wakeups per seconds, which is much better :) This bug
can probably be closed now. Will version 2.2.1 be pushed for Fedora 8 eventually ?

Comment 3 Tomas Smetana 2008-01-25 11:01:10 UTC
I'll take a look at the new version and if it doesn't break API (I think I saw
something in the new release I didn't like) I will push it into F-8.

Closing the bug as per comment #2.


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