Comment 82 for bug 508516

Revision history for this message
jim_charlton (charltn) wrote :

Thanks for the kind offer of the beverage. :-) No reward is required. I work on this stuff for amusement. :-)

I was wondering why installing bootchart solved the slow boot and slow resume from hibernate. I got the sources for bootchart. There is a script installed in the initramfs that runs under init-top called "bootchart". It sets up a mini file system in /dev, chroots to it, and starts a program called "collector" which is a compiled C program that collects statistics on the boot process. (if you want to compile collector from sources (bootchart-collector.c), you need to use the gcc parameter -mtune=i386 to get a binary like the one that is installed by "apt-get install bootchart").

To make a long story short, launching of "collector" cures the slow boot. I slowly stripped all of the code out of "collector" until there was nothing left but an infinite "for loop". "for (;;) { ; }" . That alone was enough to get the boot process to run at top speed. Once the machine boots, one can see that the "collector" process is taking about 98% of the CPU cycles of at least one of the CPUs, and sometimes both of them. I just kill the process to not stress the machine.

It appears that "collector" just saturates the CPUs, and this alone is enough to cure the slow boot problem. Why??? I don't know. I tried many other short C programs with various looping structures, but only those that run pretty well flat out, are able to cure the slow boot process.