HAL on ARM

Rob Taylor rob.taylor at codethink.co.uk
Thu Nov 8 07:23:43 PST 2007


Tom wrote:
> About a year ago there was a post about HAL startup time when running
> on the Nokia 770.
> (http://lists.freedesktop.org/archives/hal/2006-October/006421.html)
> 
> Has anyone done any profiling of HAL's startup time and memory usage
> of the recent version (0.5.10) on an ARM system?
> 
> I'm curious as to whether running HAL on an embedded device is practical.
>

I'm actually in the process of looking at this again as we speak!
Currently its still about 2 seconds to start-up on an N800.

I'm looking at a few things right now:

 1) a lot of start-up time seems to be spent in page faults as the
coldplug phase rapidly dirties several megs of ram.

 2) about 14% of the time is spent repeatedly searching the device store
for the 'linux.sysfs_path' key.

 3) a lot of time is spent waiting to go runnable as probing and addon
processes are started over the course of hal start-up

For 1 - udev has already done coldplugging, there should be a way to
reuse the kevents it got from the first run of udevtrigger. Right now
I'm just going back to looking at getting hal working with a call of
udevtrigger rather than doing the coldplug phase. Its rather non-trivial
due to ordering issues (the reason coldplug takes up so much memory is
mostly due to generating lists of sysfs_device structs and then sorting
them by their sysfs paths).

For 2 - This should be easily optimisable by keeping a hash of sysfs
paths to HalDevices and using that rather than using
hal_device_store_match_key_value_string every time (which is O(num devices))

For 3 - There might be a win here if we shift running probers and addons
to the end of coldpluggin. Another big win could be converting more
addons to be singletons [1], depending on your hardware.


Long term, David Zeuthen and Kay Sievers have some very funky plans that
should be a big win all round, but that's more for them to talk about
than I :)

Thanks,
Rob

[1] http://lists.freedesktop.org/archives/hal/2007-June/008547.html
(These patches are in mainline, but looks like the spec on hal.fd.o is a
bit out of date)

-- 
Rob Taylor, Codethink Ltd. -  http://codethink.co.uk


More information about the hal mailing list