hald constantly eating cpu

Joe Marcus Clarke marcus at freebsd.org
Tue Apr 22 18:05:23 UTC 2008


Jan Henrik Sylvester wrote:
> Joe Marcus Clarke wrote:
>> Jan Henrik Sylvester wrote:
>>> After booting, top always shows about 4% user and 10% system without 
>>> any process having any (W)CPU. If I stop hald, everything goes down 
>>> to 0, if I start hald again after that, the cpu usage goes up again.
>>
>> This is most likely caused by the two mouse pollers.  You can follow 
>> the HAL FAQ at http://www.freebsd.org/gnome/docs/halfaq.html to see 
>> how you can ignore these two devices.  That will disable auto-config 
>> of the mice in X, but it should reduce the CPU usage.
> 
> Thank you! I had to ignore both psm0 and ums0 to solve the problem.
> 
> I thought 10-mouse-sysmouse.fdi was introduced exactly to solve this 
> problem. Or is there something special about my setup (with sysmouse 
> providing a potential ums0 and psm0 being controlled by synaptics)?

The poller is designed to check to see if a mouse device is already 
opened by moused or X.  Based on that, it changes the hal properties for 
the device.  Since the addon spawns fstat, this causes a lot of exec() 
calls which takes system CPU.

> 
> This was quite hard to track down since no process showed up using the 
> CPU. Only because I had read the commit message for hal and the thread 
> in freebsd-gnome, I even tried to disable hald. Should mice be generally 
> excluded from hal until the problem is really solved? Maybe I 
> misunderstood something.

Ideally, the addon should be using procstat.  Now that procstat is 
available on -CURRENT and RELENG_7, I will port the addon to using that 
API instead of calling fstat.  That will greatly reduce the CPU 
overhead.  Using kvm for this one addon was severe overkill which is why 
I didn't use it from the start.

Joe

> 
> Jan Henrik
> 


-- 
Joe Marcus Clarke
FreeBSD GNOME Team	::	gnome at FreeBSD.org
FreeNode / #freebsd-gnome
http://www.FreeBSD.org/gnome


More information about the freebsd-gnome mailing list