degraded performance of update-grub 1.99-2ubuntu1 and higher

Bug #787461 reported by syscon-hh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
Medium
Colin Watson
Oneiric
Fix Released
Medium
Colin Watson

Bug Description

Binary package hint: grub2

The time to procede a "sudo update-grub" during an installation or deinstallation a kernel is not acceptable long. This happens since update to version 1.99-4ubuntu1. Additionally the CPU is running at 100% the whole time.

Output terminal during deinstallation:

laura@ONEIRIC-4GDM32:~$ sudo apt-get purge linux-headers-2.6.39-2 linux-image-2.6.39-2-generic
[sudo] password for laura:
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut
Statusinformationen werden eingelesen... Fertig
Die folgenden Pakete werden ENTFERNT:
  linux-headers-2.6.39-2* linux-headers-2.6.39-2-generic*
  linux-image-2.6.39-2-generic*
0 aktualisiert, 0 neu installiert, 3 zu entfernen und 1 nicht aktualisiert.
Nach dieser Operation werden 214 MB Plattenplatz freigegeben.
Möchten Sie fortfahren [J/n]?
(Lese Datenbank ... 190179 Dateien und Verzeichnisse sind derzeit installiert.)
Entfernen von linux-headers-2.6.39-2-generic ...
Entfernen von linux-headers-2.6.39-2 ...
Entfernen von linux-image-2.6.39-2-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 2.6.39-2-generic /boot/vmlinuz-2.6.39-2-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 2.6.39-2-generic /boot/vmlinuz-2.6.39-2-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.39-3-generic
Found initrd image: /boot/initrd.img-2.6.39-3-generic
Found linux image: /boot/vmlinuz-2.6.38-8-generic
Found initrd image: /boot/initrd.img-2.6.38-8-generic
done
The link /vmlinuz.old is a damaged link
Removing symbolic link vmlinuz.old
 you may need to re-run your boot loader[grub]
The link /initrd.img.old is a damaged link
Removing symbolic link initrd.img.old
 you may need to re-run your boot loader[grub]
Löschen der Konfigurationsdateien von linux-image-2.6.39-2-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 2.6.39-2-generic /boot/vmlinuz-2.6.39-2-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 2.6.39-2-generic /boot/vmlinuz-2.6.39-2-generic
laura@ONEIRIC-4GDM32:~$

The times of the example are:

- until "Generating grub.cfg ..." = 45 sec

- time to provide first pair of kernelimages = 2:30 min

- time topprovide second pair of kernelimages = 1:30

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: grub-pc 1.99-4ubuntu1
ProcVersionSignature: Ubuntu 2.6.39-3.9-generic 2.6.39
Uname: Linux 2.6.39-3-generic i686
Architecture: i386
Date: Tue May 24 11:47:15 2011
ProcEnviron:
 LANGUAGE=de_DE:en
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
SourcePackage: grub2
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
syscon-hh (syscon-kono) wrote :
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report. I can confirm the performance loss between grub 1.99~rc1-13ubuntu3 and 1.99-2ubuntu1.

1.99-4ubuntu1
00:00.00 Generating grub.cfg ...
00:24.83 Found linux image: /boot/vmlinuz-2.6.39-3-generic
00:24.90 Found initrd image: /boot/initrd.img-2.6.39-3-generic
00:33.85 Found linux image: /boot/vmlinuz-2.6.39-2-generic
00:33.91 Found initrd image: /boot/initrd.img-2.6.39-2-generic
00:34.07 Found linux image: /boot/vmlinuz-2.6.39-1-generic
00:34.12 Found initrd image: /boot/initrd.img-2.6.39-1-generic
00:34.26 Found linux image: /boot/vmlinuz-2.6.38-8-generic
00:34.31 Found initrd image: /boot/initrd.img-2.6.38-8-generic
00:46.87 Found memtest86+ image: /boot/memtest86+.bin
00:50.42 Found Windows 7 (loader) on /dev/sda1
00:59.42 Found Windows Recovery Environment (loader) on /dev/sda2
01:08.37 done

1.99-2ubuntu1
Same results than with 1.99-4ubuntu1

1.99~rc1-13ubuntu3
00:00.00 Generating grub.cfg ...
00:02.87 Found linux image: /boot/vmlinuz-2.6.39-3-generic
00:02.93 Found initrd image: /boot/initrd.img-2.6.39-3-generic
00:04.01 Found linux image: /boot/vmlinuz-2.6.39-2-generic
00:04.07 Found initrd image: /boot/initrd.img-2.6.39-2-generic
00:04.24 Found linux image: /boot/vmlinuz-2.6.39-1-generic
00:04.29 Found initrd image: /boot/initrd.img-2.6.39-1-generic
00:04.42 Found linux image: /boot/vmlinuz-2.6.38-8-generic
00:04.48 Found initrd image: /boot/initrd.img-2.6.38-8-generic
00:05.86 Found memtest86+ image: /boot/memtest86+.bin
00:09.43 Found Windows 7 (loader) on /dev/sda1
00:10.48 Found Windows Recovery Environment (loader) on /dev/sda2
00:11.66 done

Changed in grub2 (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
summary: - sudo update-grub takes extremely time
+ degraded performance of update-grub 1.99-2ubuntu1 and higher
Revision history for this message
Colin Watson (cjwatson) wrote :

I'm not seeing any particular reason for it while diffing the debug output, but 'grub-probe --target=device /' (say) does seem to have roughly halved in performance for me. (I'm on an SSD so a difference in the magnitude of slowdown is to be expected.)

Revision history for this message
Colin Watson (cjwatson) wrote :

Ah - under strace, I see it doing things like trying to successively open /dev/disk/by-id/ata-INTEL_SSDSA2M080G2GC_CVPO003401FW080BGN1 up to 9999. Not ideal!

Colin Watson (cjwatson)
Changed in grub2 (Ubuntu Oneiric):
status: Confirmed → In Progress
assignee: nobody → Colin Watson (cjwatson)
milestone: none → oneiric-alpha-1
Revision history for this message
Colin Watson (cjwatson) wrote :

2011-05-09 Vladimir Serbinenko <email address hidden>

       * grub-core/kern/emu/hostdisk.c (linux_find_partition): Don't abort
       on first non-existant partition.

The problem isn't easily reproducible with a plain upstream build, but that's mainly because Ubuntu patches do extra probing to arrange for LVM and RAID to work when /boot/grub/device.map doesn't exist.

Revision history for this message
Colin Watson (cjwatson) wrote :

(Also, my figure of halving in performance was bogus; I was looking at user time, not wallclock time. 7 seconds versus 43 seconds is more like what I'm seeing.)

Colin Watson (cjwatson)
Changed in grub2 (Ubuntu Oneiric):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 1.99-4ubuntu2

---------------
grub2 (1.99-4ubuntu2) oneiric; urgency=low

  * Give up scanning partitions after ten consecutive open failures
    (LP: #787461).
 -- Colin Watson <email address hidden> Fri, 27 May 2011 14:07:30 +0100

Changed in grub2 (Ubuntu Oneiric):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.