After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 615338 - Hamster makes excessive CPU wakeups
Hamster makes excessive CPU wakeups
Status: RESOLVED FIXED
Product: hamster-applet
Classification: Deprecated
Component: general
2.30.x
Other Linux
: Normal normal
: ---
Assigned To: hamster-applet-maint
hamster-applet-maint
: 620599 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-04-10 00:57 UTC by Marti
Modified: 2010-06-04 23:26 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Marti 2010-04-10 00:57:21 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)
Comment 1 Toms Bauģis 2010-04-10 10:43:38 UTC
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
Comment 2 patrickdk 2010-05-07 05:45:34 UTC
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.
Comment 3 Toms Bauģis 2010-05-14 21:52:51 UTC
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
Comment 4 patrickdk 2010-05-15 02:10:30 UTC
The patch seems to be working good for me :)
Comment 5 Toms Bauģis 2010-06-04 21:01:41 UTC
*** Bug 620599 has been marked as a duplicate of this bug. ***
Comment 6 James Ralston 2010-06-04 23:26:17 UTC
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