Bug 128651 - gam_server CPU chew ...
Summary: gam_server CPU chew ...
Status: RESOLVED FIXED
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: GNOME (show other bugs)
Version: Final
Hardware: Other Other
: P5 - None : Major
Target Milestone: ---
Assignee: Robert Love
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-17 08:35 UTC by Michael Meeks
Modified: 2006-01-23 09:52 UTC (History)
0 users

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2005-10-17 08:35:04 UTC
Why does the gam_server have a busy-loop ? Quite often, when it does it's work
in the right timeslice one can see it contributing to wasting ones battery in 'top':

poll([{fd=1, events=0}, {fd=2, events=POLLIN}, {fd=1, events=POLLIN}, {fd=5,
events=POLLIN}, {fd=0, events=POLLIN}, {fd=4, events=POLLIN}, {fd=3,
events=POLLIN}], 7, 32) = 0
gettimeofday({1129537823, 955287}, NULL) = 0
gettimeofday({1129537823, 955492}, NULL) = 0
<repeat poll no further sys-calls>

why a 32ms timeout ? surely it serves no useful purpose (given the lack of
sys-calls) to do this ? surely a well behaved app should sit in 'poll' waiting
for event notifications without waking up 30 times a second to do (unnecessary?)
work ?
Comment 1 Robert Love 2006-01-20 19:29:23 UTC
I spent some time investigating this.  The view is not pretty.  Essentially, gamin is full of timers and it wakes up numerous times a second for numerous reasons--the worst offender being a 33ms wake up.

I alleviated the problem by increasing many of the timer intervals and making other timers opportunistic, only running when there is work to do.

Gamin now wakes up only a couple of times per second.  This is a magnitude improvement.  It won't get any better without a hefty gamin rewrite.

In talking to jpr, we have decided to check my fixes into Code10 but not issue an update for 10.0.
Comment 2 Michael Meeks 2006-01-23 09:52:07 UTC
Nice - thanks :-)