GNOME Bugzilla – Bug 615338
Hamster makes excessive CPU wakeups
Last modified: 2010-06-04 23:26:17 UTC
Whenever I have the Hamster panel applet enabled, PowerTop reports 88-90 wakeups/s to a "python" process that is Hamster. This is a significant power hog for laptops working on battery power. Strace of the process reveals a continuous poll() loop with a short timeout: poll([{fd=5, events=POLLIN}, {fd=4, events=POLLIN}, {fd=11, events=POLLIN|POLLPRI}, {fd=8, events=POLLIN}, {fd=13, events=POLLIN}, {fd=15, events=POLLIN|POLLPRI}, {fd=16, events=POLLIN|POLLPRI}, {fd=17, events=POLLIN|POLLPRI}, {fd=19, events=POLLIN|POLLPRI}, {fd=18, events=POLLIN|POLLPRI}, {fd=7, events=POLLIN|POLLPRI}, {fd=20, events=POLLIN|POLLPRI}, {fd=21, events=POLLIN|POLLPRI}, {fd=23, events=POLLIN}], 14, 0) = 0 (Timeout) read(4, 0x1967d04, 4096) = -1 EAGAIN (Resource temporarily unavailable) At first I suspected some internal Hamster GTK timer, but this seems not to be the case; there are only two timers used in Hamster code: a 20ms animation timer and some 60s timer. I verified myself that the chart animation timer is not being ran at this time. Powertop output: PowerTOP version 1.11 (C) 2007 Intel Corporation Cn Avg residency P-states (frequencies) C0 (cpu running) ( 1.8%) 1.81 Ghz 0.1% C0 0.0ms ( 0.0%) 1.80 Ghz 0.1% C1 mwait 0.0ms ( 0.0%) 1200 Mhz 0.0% C2 mwait 0.2ms ( 0.0%) 800 Mhz 99.9% C4 mwait 5.9ms (98.2%) Wakeups-from-idle per second : 167.4 interval: 15.0s no ACPI power usage estimate available Top causes for wakeups: 42.5% ( 88.1) python : hrtimer_start_range_ns (hrtimer_wakeup) 28.5% ( 59.1) <interrupt> : extra timer interrupt 8.7% ( 18.1) <kernel core> : hrtimer_start_range_ns (tick_sched_timer) 7.8% ( 16.3) <interrupt> : PS/2 keyboard/mouse/touchpad 4.6% ( 9.5) <interrupt> : ata_piix 2.6% ( 5.3) <kernel core> : hrtimer_start (tick_sched_timer)
we are using gobject.timeout_add_seconds[1] to refresh hamster every 60 seconds. i don't really know what to do with this bug - Marti, could you maybe continue your investigation? :) [1] http://library.gnome.org/devel/pygobject/stable/glib-functions.html#function-glib--timeout-add-seconds
I am defently hitting this also. I never noticed it in ubuntu karmic, but I have just upgraded to lucid on my laptop, and noticed my laptop battery didn't even last an hour, and noticed that python hamster applet is waking up a lot and the cpu usage on it is the highest of any program I have running on my system.
thanks for the report. fix was trivial, hunting down took a while though. turned out to be a "are we there yet?" ride with some of the widgets waiting for a window. fix pushed to git master and 2-30
The patch seems to be working good for me :)
*** Bug 620599 has been marked as a duplicate of this bug. ***
The exact commit was 5dd38415494395436e9ebf80433fcbd199120217, in case anyone else needs to go looking for it: http://git.gnome.org/browse/hamster-applet/commit/?id=5dd38415494395436e9ebf80433fcbd199120217