You are not logged in.
I discovered e4rat recently (thanks to the Arch community) and have been quite pleased with it. But one place where it can be improved is the time it takes to load inodes from the disk before starting /sbin/init. I've cooked up a replacement for e4rat-preload that takes much less time at this stage (about 1/2 second rather than 3 on my system). The savings come from (1) using pure C with no external library dependencies, which drops the number of linked .so files from 22 to 3, and (2) preloading only the first 100 files (both inodes and file contents) before starting /sbin/init, then continuing to load the remaining files in parallel with the normal boot sequence.
The source (a C file) is at http://www.box.net/shared/4cpzqtylck.
My results are:
Without e4rat-preload: 19.7 seconds to idle (bootchart http://www.box.net/shared/e9r8z4yjxc)
With existing e4rat-preload: 16.7 seconds to idle (bootchart http://www.box.net/shared/vht1879v7j)
With replacement e4rat-preload: 13.9 seconds to idle (bootchart http://www.box.net/shared/lhortactgi)
I am interested to hear if this makes a difference on other systems as well.
EDIT: I made a small change to the C file. (The link is still the same.)
EDIT 2: Updated times and bootcharts.
Last edited by jlindgren (2011-04-30 02:00:36)
Offline
Feeling like the noob here but how is that modification applied? I mean, do you have to reinstall e4rat switching files, patching something or how...?
Can't test it without knowing how to use it, but sounds interesting.
Best Testing Repo Warning: [testing] means it can eat you hamster, catch fire and you should keep it away from children. And I'm serious here, it's not an April 1st joke.
Offline
Sorry, I should have given some instructions. You don't have to do anything to your e4rat installation, this is just one executable that will sit side by side with it.
Compile the C file and copy the executable to /usr/sbin:
$ gcc -std=c99 -Wall -O2 -o e4rat-preload-lite e4rat-preload-lite.c
$ strip -s e4rat-preload-lite
$ sudo cp e4rat-preload-lite /usr/sbin
Then use init=/usr/sbin/e4rat-preload-lite instead of init=/usr/sbin/e4rat-preload on the Grub command line.
Offline
Seems to shave a couple of seconds off the boot, thanks.
Offline
I've found a problem. This doesn't seem to respect e4rat.conf and it fails to find my custom path for the startup.log and causes a kernel panic.
Also, e4rat also complained that the executable should be located in /sbin not /usr/sbin.
Offline
You'll have to change this line:
#define LIST "/var/lib/e4rat/startup.log"
You can put the executable anywhere you want.
Offline
Ty, that worked. Shaved an additional second off of my boot!
I guess there is somewhere that you can declare where the executable is. e4rat said it couldn't find it /usr/sbin.
Offline
Maybe submit your code to the author for improvement of the project?
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
I guess there is somewhere that you can declare where the executable is. e4rat said it couldn't find it /usr/sbin.
I guess I'm not sure what you mean. Why should e4rat (and which part) want to know where the executable is?
Offline
Maybe submit your code to the author for improvement of the project?
I may do that.
EDIT: Done.
Last edited by jlindgren (2011-04-30 02:01:43)
Offline
Great!! I installed e4rat today and I tried your improved e4rat-preload on Core 2 Duo E4500, western digital green HDD, arch 64 and KDE 4.6. I measured time "manually" since I press OS selection from grub2 to KDE welcome sound.
Without e4rat-preload: 26s
With existing e4rat-preload: 21s
With replacement e4rat-preload: 19s
Windows 7: 55s
Has somebody tried e4rat + systemd? it improves a lot vs e4rat + normal sysinit?
Offline
graysky wrote:Maybe submit your code to the author for improvement of the project?
I may do that.
EDIT: Done.
Anyone can tell if this code has already been implemented by the e4rat dev(s)?
Offline
Not until we get an e4rat update from the AUR.
never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::
Offline
toad - e4rat has been taken into [community] a while ago...
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Hi everyone,
is e4rat-lite still usable? Or is this obsolete now?
Offline
Hi everyone,
is e4rat-lite still usable? Or is this obsolete now?
Yup, and I took to effort to add it to AUR:
https://aur.archlinux.org/packages.php?ID=54631
Last edited by sploit (2011-12-06 10:17:50)
Offline
Wow, this was fast.
Off-topic: I'm getting some error-messages and I forgot the command to run a terminal-program in english (my system has german locale setting). What command do I have to use?
Offline
I've tested your package from AUR, but it doesn't work for me. I'm using e4rat with systemd, but it seems as if e4rat-preload-lite isn't using the configs from e4rat, so it runs initd and I'm landing in an single user enviroment.
Offline
I've tested your package from AUR, but it doesn't work for me. I'm using e4rat with systemd, but it seems as if e4rat-preload-lite isn't using the configs from e4rat, so it runs initd and I'm landing in an single user enviroment.
Did you change the config's location from the default?
Either link it or place it back in the right location.
Default location:
/var/lib/e4rat/startup.log
So you might want to place a link over there...
Last edited by sploit (2011-12-06 10:40:46)
Offline
Sorry, got it now. Runs perfect!
Many thanks for this.
Thorsten Reinbold wrote:I've tested your package from AUR, but it doesn't work for me. I'm using e4rat with systemd, but it seems as if e4rat-preload-lite isn't using the configs from e4rat, so it runs initd and I'm landing in an single user enviroment.
Did you change the config's location from the default?
Either link it or place it back in the right location.
Default location:
/var/lib/e4rat/startup.logSo you might want to place a link over there...
No, this wasn't the reason. I just downloaded the source with "makepkg --nobuild", changed the line "#define INIT" in e4rat-preload-lite.c to "/bin/systemd" an compiled it with "makepkg -e --skipchecksums --skipinteg". That did the trick for me.
Last edited by Thorsten Reinbold (2011-12-06 10:43:36)
Offline
Sorry, got it now. Runs perfect!
Many thanks for this.
That was faster than I could reply
You're welcome!
cheers
Offline
Have a look at my edit in the posting above. I guess that e4rat-preload-lite is not recognizing e4rats config file, so I've had to make those changes in the source. Maybe there is room for improvements.
Offline
If you can write a script that checks if the user uses systemd or regular init, i'll happily add it. (I'm not running systemd, so it's hard to test)
Offline
Sorry, but I'm not that good. I'm still a humble follower.
But as mentioned above: what about to make e4rat-preload-lite look at the main config from e4rat? That would be the best solution (I think), as everyone with systemd will change the setting at this place.
Edit: in the meantime it would be a good Idea to post this information (changing "#define INIT") on the AUR page.
Last edited by Thorsten Reinbold (2011-12-06 11:05:09)
Offline
toad - e4rat has been taken into [community] a while ago...
Wow! Never noticed
EDIT:
Time to update the wiki methinks. However, I haven't used my laptop in a while so I'd rather not do it (yet). Prefer if somebody does it who knows what they are talking about.
Last edited by toad (2011-12-06 11:06:34)
never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::
Offline