[Top][All Lists]

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

Slow disk access

From: Marco Gerards
Subject: Slow disk access
Date: Fri, 04 Feb 2005 21:11:48 +0000
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)


The disk access on GRUB 2 is terribly slow.  At first I thought it was
only a problem on the PPC, but it is also showing up in grub-emu and I
guess on the PC as well.  You can notice the problem when reading in
big files, like a big kernel.  Reading in a 20MB files takes 17

In this e-mail I will propose some things that could make GRUB work
smoother.  Some ideas are just plain silly, but I want to address the
issue at all levels.  If someone has other suggestions, please tell
me.  This is an important and serious issue we have to deal with.  It
would also be very nice if someone could test if the problem occurs on
the PC as well (when booting that is).

The load time of 17 seconds can be easily be reduced to one or two
seconds by increasing GRUB_DISK_CACHE_SIZE from 8 to 128.  So that
means the problem is that the writes are devices up in too many small
reads, I guess.  I don't think this is a good solution, but feel free
to convince me otherwise. :)

One thing that fshelp does is reading files on behalf of the
filesystems.  It checks per filesystem block to which disk block it
belongs and reads it.  What we could change is that the blocks will
only be read when they get out of order.  So instead of:

1, 2, 3, 6, 7, 10

It should read the blocks like:

1-3, 6-7, 10

This of course does not matter with such small ranges, but it could
improve the performance when reading more than GRUB_DISK_CACHE_SIZE.

Which brings me to the next problem: grub_disk_read does just read 8
blocks at a time, not what was requested.

And of course that is not the last problem.  Even if the filesystem
and disk.c would work in a way multiple blocks would be read, the
grub_file_read caller would have to read multiple blocks as well.

So I really hope I am not understanding the problem at all and it is
something else.  Perhaps I can have a more detailed look at this
tomorrow by studying GRUB 2 and GRUB Legacy, to see that does not have
the same problems.

I would appreciate if someone who could test big files by booting from
a PC to see if the problem was there too.  Patches to fix this
properly would be better of course, but for that we need to know what
to fix. :)


reply via email to

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