Skip to contentSkip to conversation

improve boot time with standalone images

PATCH In review Vladimir 'φ-coder/phcoder' Serbinenko 1 participant 2 messages Dec 22, 2013 – Dec 23, 2013 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 improve boot time with standalone images

Hello, all. While testing on raspberry pi using standalone image I've noticed that all file operations were sluggish. The culprit was tar that we use as a filesystem for memdisk which requires complete scan to find one file. On most systems it's a minor time penalty but on raspberry pi it almost halved boot time. I propose a specialised compact and fast uncompressed read-only filesystem by storing filenames in sorted array and using binary search. It's a pretty big change but I feel like it's worth to be put into 2.02.
Does anybody disagree?

Makefile.util.def +1 -0
index 27c48e5..d9f7e64 100644
@@ -119,6 +119,7 @@ library = {
   common = grub-core/fs/sfs.c;
   common = grub-core/fs/squash4.c;
   common = grub-core/fs/tar.c;
+  common = grub-core/fs/greffs.c;
   common = grub-core/fs/udf.c;
   common = grub-core/fs/ufs2.c;
   common = grub-core/fs/ufs.c;
grub-core/Makefile.core.def +5 -0
index e5e558c..da3a599 100644
@@ -1400,6 +1400,11 @@ module = {
 };
 
 module = {
+  name = greffs;
+  common = fs/greffs.c;
+};
+
+module = {
   name = udf;
   common = fs/udf.c;
 };
grub-core/fs/greffs.c new file +314 -0

314 lines not on this page · raw message

include/grub/greffs.h new file +55 -0

55 lines not on this page · raw message

util/grub-mkstandalone.c +153 -123

348 lines not on this page · raw message

#1 lore raw
Quoted 10 lines · Vladimir 'φ-coder/phcoder' Serbinenko

Hello, all. While testing on raspberry pi using standalone image I've noticed that all file operations were sluggish. The culprit was tar that we use as a filesystem for memdisk which requires complete scan to find one file. On most systems it's a minor time penalty but on raspberry pi it almost halved boot time. I propose a specialised compact and fast uncompressed read-only filesystem by storing filenames in sorted array and using binary search. It's a pretty big change but I feel like it's worth to be put into 2.02.
Does anybody disagree?

After discussing with Leif Lindholm, it was found out that real culprit was disabled cache on U-boot port.
Time to console
Cached, tar: 0.5s
Cached, greffs: 0.3s
Uncached tar: 7.3s
Uncached greffs: 4.3s
On coreboot the speed-up is only 4ms