grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A patch to enhance biosdisk initrd loading speed for grub2


From: Wang Weber
Subject: A patch to enhance biosdisk initrd loading speed for grub2
Date: Wed, 1 Aug 2012 22:04:44 +0800

Hi,

I am very interested in GRUB2. Recently I found that the linux initrd loading speed (i386-pc) is quite poor compared with GRUB1. I compared grub-1.98 with grub0.97, it is almost 7 times worse. 

After checking the code of them, the reason is GRUB1 has a simple track buffer for biosdisk, every time it tries to read a whole track from disk if possible. For GRUB2, there is no such buffer, so it will read less than a track every time. This greatly affects the performance of disk reading.

I see that grub2.00 extends the generic disk cache from 8 sectors (grub1.98) to 64 sectors. This helps to increase the performance, however it is still worse than GRUB1. 

So I ported the track buffer from GRUB1 to grub1.98 and grub2.00, my test with a USB stick shows that loading a 106M initrd (it is true, we use big initrd), grub2.00 costs about 15 seconds, with this patch grub2.00 costs about 11 seconds.

The performance increment is bigger on grub1.98 than on grub2.00, because grub2.00 has a larger cache. However, I believe it is reasonable to add additional buffer layer for specific architecture/platform. Specifically for i386-pc, there is a legacy 63 sectors per track limitation, the additional buffer greatly enhance disk reading performance. 

I am very glad if you are interested in this patch, and I am glad to share it with the GRUB community. Indeed, GRUB2 is a wonderful tool, you did a great job!

Thanks,
-Wenbo(Weber)  

reply via email to

[Prev in Thread] Current Thread [Next in Thread]