gam_server eats CPU

Daniel Veillard veillard at redhat.com
Fri Mar 4 21:35:47 UTC 2005


On Fri, Mar 04, 2005 at 01:16:23PM -0800, Pete Zaitcev wrote:
> I have a situation where an application makes small writes to a file.
> In such a case, gam_server hogs the CPU. Here's a screen capture from
> top(1):
[...]
> I run Fedora Core 3 with Nautilus enabled, and so I cannot just remove
> Gamin and be happy. Does anyone have any ideas what do about this?

  Are you running gamin-0.0.25 ? 

> P.S. In case anyone is interested in details, this is what happened.
> I was looking at some USB problems with usbmon and noticed that usbmon
> drops about 0.7% packets. At first I thought it was something with SMM
> BIOS or whatnot. But then I noticed that CPU is eaten by Gamin and
> this apparently causes cat to starve sometimes. Usbmon produces a
> stream of records which are captured with:
>   cat /sys/kernel/debug/usbmon/1t > x.dump
> It is rather lightweight, without any massive copying of data by the
> kernel. E.g. the USB traffic itself creates much more copying and
> memory and cache usage.

  dnotify, you know the ugly notification kernel interface, send gam_server
one signal on every write to any file in the directories monitored. It then
has to sort out which file is modified in that directory to report to the
watching application. Gamin *do* try to do flow control the kernel does
not do, by switching to polling every second on directories which seems
busy.
  Best way to fix the problem for good: Get rid of dnotify, and bring 
inotify or any sane interface in the kernel, i.e. make sure your fellow
kernel hackers don't force us to keep relying on this utter crap interface.

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard at redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/




More information about the devel mailing list