LiveCD layout optimisation

Bug #589629 reported by Louis Simard
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Baltix
Fix Released
Undecided
Unassigned
debian-cd (Debian)
New
Undecided
Unassigned
debian-cd (Ubuntu)
Fix Released
Undecided
Unassigned
livecd-rootfs (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: livecd-rootfs

As discussed with cjwatson on IRC:

The Ubuntu Lucid LiveCD stands to have much more locality of reference than it currently has. Ideally, the boot files should be bunched together on the LiveCD, Linux modules first, then files required by boot scripts, then whatever is needed by X to start; icons for programs all in one place; and the documentation all in one place as well.

CDs can store more data at the edge (away from the centre) due to CLV [1], and need less seeking to access files.

Seeing as the Ubuntu LiveCD's boot sequence is predictable, based on the Filesystem Hierarchy Standard [2], we can make very broad assumptions about the need for file access during the boot sequence.

When the CD starts up, /usr is not read. /bin, /sbin, /lib and /lib/modules are used by the startup scripts and Linux loading up. So we can place these files together.

Then X is started, and the rest of the boot scripts. These read files from /usr/lib/dri, /etc and /bin, which will be cached (/bin/sh, /bin/awk, etc.) Conveniently the files needed by X are all in /usr/bin/X11, so we can bunch it with /etc too.

When the user wants documentation in GNOME, he/she will click links leading to other files related to what they want. So put all of these files together. But since these files are not often accessed in normal use, put them at the *start* of the disc. While /usr/share/doc is not *huge*, the documentation will occupy a lot of "radial space" on the CD (see attached CD layout image). Then normal use of the CD needs much less-wide seeks.

Sort files using these broad assumptions, for mksquashfs and mkisofs, are also attached.

[1] http://en.wikipedia.org/wiki/Constant_linear_velocity
[2] http://www.pathname.com/fhs/

Revision history for this message
Louis Simard (louis-simard-deactivatedaccount) wrote :
Revision history for this message
Louis Simard (louis-simard-deactivatedaccount) wrote :

Negative weights in this sort-file put the corresponding files at the 'end' (which will end up at the edge of the CD) of filesystem.squashfs.

Revision history for this message
Louis Simard (louis-simard-deactivatedaccount) wrote :

Negative weights in this sort-file put the corresponding files at the 'end' (which will end up at the edge of the CD) of the iso itself.

Changed in debian-cd (Debian):
status: Unknown → New
Changed in debian-cd (Debian):
importance: Unknown → Undecided
Revision history for this message
Louis Simard (louis-simard-deactivatedaccount) wrote :

I did preliminary results for this bug with a stopwatch. I'll explain my methodology in this post and put my results in the next one.

-- Definitions --

"Boot sequence time" is the time it takes between the "ISOLINUX" screen that appears when boot starts, and the Lucid orange-purple background just before the "Install/Try Ubuntu 10.04" dialog.

"Applications menu time" is the time it takes between clicking "Try Ubuntu 10.04", and GNOME's Applications menu appearing.

"Firefox startup time" is the time it takes between clicking the Firefox icon in GNOME, and a window starting to appear.

"Flareon" is a Compaq v2500ca laptop computer (512 MB RAM).
"Jolteon" is an HP Pavilion a6218x computer (4 GB RAM).
"Jigglypuff" is an Acer Aspire AST660 computer (512 MB RAM).

"Original" is the official build of Ubuntu 10.04 GNOME 32-bit.
"Reordered" is Original with the sort file for mksquashfs applied.

Revision history for this message
Louis Simard (louis-simard-deactivatedaccount) wrote :

Boot sequence time | Original | Reordered | Verdict
-------------------+------------+------------+-------------
Flareon | 2 min 32.9 | 2 min 08.1 | 16.3% impr.
Jolteon | 1 min 43.2 | 1 min 34.1 | 8.9% impr.
Jigglypuff | 1 min 59.5 | 1 min 47.6 | 10.0% impr.

Applications menu time | Original | Reordered | Verdict
-----------------------+------------+------------+-------------
Flareon | 1 min 09.2 | 1 min 11.5 | slight regr.
Jolteon | 32.19 sec | 29.27 sec | 9.1% impr.
Jigglypuff | 1 min 21.9 | 1 min 07.4 | 17.7% impr.

Firefox startup time | Original | Reordered | Verdict
---------------------+------------+------------+-------------
Flareon | 22.87 sec | 19.42 sec | 15.1% impr.
Jolteon | 11.35 sec | 12.36 sec | 8.9% regr.
Jigglypuff | 27.02 sec | 23.39 sec | 13.4% impr.

Revision history for this message
Louis Simard (louis-simard-deactivatedaccount) wrote :

Now doing tests with the bootchart package, which was added to Maverick dailies on 2010-06-10. Thanks cjwatson!

The boot time BEFORE the mksquashfs optimisation is 2 minutes 05.33 seconds.

Revision history for this message
Louis Simard (louis-simard-deactivatedaccount) wrote :

The boot time AFTER the mksquashfs optimisation is 1 minute 59.09 seconds.

Of note: I had to work around bug 512172 in pybootchartgui to generate the images. And this is on the Jolteon defined above.

Revision history for this message
Louis Simard (louis-simard-deactivatedaccount) wrote :

This sort file makes ISOLINUX bring up the screen with boot options in less than 2 seconds after first displaying ISOLINUX, by putting every file read by ISOLINUX in sequence right at the start of the disc.

Revision history for this message
Louis Simard (louis-simard-deactivatedaccount) wrote :

As I just saw and posted about on ubuntu-devel-discuss [1], using the new squashfs layout file for a CD made Ubuntu's hard-disk install size 180 MB bigger on ext4. I presume it's due to extent allocation breaking due to the pattern of file copies.

The status of this bug now depends on whether Live CD boot time or hard-disk installed size is most important for Ubuntu.

[1] https://lists.ubuntu.com/archives/ubuntu-devel-discuss/2010-October/012198.html

Revision history for this message
Martin Pitt (pitti) wrote :

Personally I think that six seconds won at livefs boot time (at a boot time of two minutes) isn't enough of an advantage to sacrifice 180 MB of installed size.

Changed in livecd-rootfs (Ubuntu):
status: New → Incomplete
Revision history for this message
Louis Simard (louis-simard-deactivatedaccount) wrote :

Personally I don't know how to go about looking for the root cause of this 180 MB increase, or I would.

On ext3 the new disc did not do this. It must be something related to ext4. This is all I know.

Thanks for your review, Martin. :)

liu bo (1300733887-9)
Changed in livecd-rootfs (Ubuntu):
assignee: nobody → liu bo (1300733887-9)
status: Incomplete → Fix Committed
status: Fix Committed → Opinion
Changed in baltix:
status: New → Fix Committed
Changed in debian-cd (Ubuntu):
status: New → Fix Committed
Changed in baltix:
status: Fix Committed → New
status: New → Incomplete
Changed in livecd-rootfs (Ubuntu):
status: Opinion → Fix Released
Changed in baltix:
status: Incomplete → Fix Released
Changed in debian-cd (Ubuntu):
status: Fix Committed → Fix Released
Changed in baltix:
assignee: nobody → liu bo (1300733887-9)
Changed in debian-cd (Debian):
assignee: nobody → liu bo (1300733887-9)
Changed in debian-cd (Ubuntu):
assignee: nobody → liu bo (1300733887-9)
Revision history for this message
Adolfo Jayme Barrientos (fitojb) wrote :

Launchpad is not a place for playing around...

Changed in baltix:
assignee: liu bo (1300733887-9) → nobody
Changed in debian-cd (Debian):
assignee: liu bo (1300733887-9) → nobody
Changed in debian-cd (Ubuntu):
assignee: liu bo (1300733887-9) → nobody
Changed in livecd-rootfs (Ubuntu):
assignee: liu bo (1300733887-9) → nobody
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.