Bug#508834: grub-common: grub-probe is painfully slow to execute due to excessive ioctl(BLKFLSBUF)

Robert Millan rmh at aybabtu.com
Tue Mar 31 21:40:53 UTC 2009


severity 508834 wishlist
thanks

On Mon, Dec 15, 2008 at 02:42:55PM -0600, Max Bowsher wrote:
> Package: grub-common
> Version: 1.96+20080724-12
> Severity: important
> 
> Hi,
> For me, update-grub is _painfully_ slow to execute, taking 10-30minutes!
> I've tracked this to its use of grub-probe. An example grub-probe
> command, such as:
> 
> grub-probe --device-map=/boot/grub/device.map --device /dev/sda3 --target=fs_uuid
> 
> takes something like 10 minutes to execute. Analysis with strace shows
> almost all the time is spent in ioctl(BLKFLSBUF), which is executed
> over and over again - 59 times for the command above.
> Running with -v shows that grub-probe is re-opening the partition
> devices repeatedly. In the command above, after opening all the
> partitions in my system a few times (why, when specifically asked about
> one?), it proceeded to open /dev/sda3 31 times before finally returning
> the requested UUID.
> 
> I'm selecting this as severity=important, since the immediate
> manifestation of the bug is that any attempt to install/upgrade a kernel
> package seems to hang when it invokes update-grub.

It's rather unusual for BLKFLSBUF to take that long.  There's room for
improvement in GRUB, but this is basically an issue in Linux (maybe
your disk driver?).

I'm leaving this open, in case someone feels like working on optimizing
grub-probe.

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."





More information about the Pkg-grub-devel mailing list