Bug 618

Summary: [qemuppc] qemuppc first time booting needs more than 4 minutes
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Jiajun Xu <jiajun.xu>
Component: coreAssignee: Liming Wang <liming.wang>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: Medium CC: ke.yu, kunwei.tian, liang.li2, liming.wang, meta.mr.watcher, meta.watcher, richard.purdie, sgw, song.liu, yi.zhao
Version: unspecified   
Target Milestone: 1.1   
Hardware: x86   
OS: Multiple   
Whiteboard: status quo on this issue. /dev/fb access slow initial boot (Aug 5, 2011)
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Jiajun Xu 2010-12-27 07:09:43 UTC
Testing Env:    
Host: Ubuntu 10.04 LTS
Kernel: 2.6.32-21-generic-pae
qemuppc images from weekly build 20101218,
http://autobuilder.pokylinux.org/milestone/20101218-1/qemu/qemuppc/

Pls. check comments in bug 143 also. qemuppc first time booting needs more than 4 minutes on my machine. The issue exists before also.
Comment 2 Yi Zhao 2010-12-27 22:51:14 UTC
This is also happened on beagleboard
Image from nightly build 20101225
http://autobuilder.pokylinux.org/nightly/20101225-1/qemu/qemubeagleboard/

When first time booting, it will wait for a long time after printing following message and give me a login prompt.

######################
TCP cubic registered
NET: Registered protocol family 17
Power Management for TI OMAP3.
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 1
regulator_init_complete: incomplete constraints, leaving VDVI on
regulator_init_complete: incomplete constraints, leaving VDAC on
twl_rtc twl_rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
Waiting for root device /dev/mmcblk0p2...
mmc0: new high speed SD card at address 1234
mmcblk0: mmc0:1234 SA02G 1.83 GiB 
 mmcblk0: p1 p2
kjournald starting.  Commit interval 5 seconds
EXT3-fs (mmcblk0p2): using internal journal
EXT3-fs (mmcblk0p2): recovery complete
EXT3-fs (mmcblk0p2): mounted filesystem with writeback data mode
VFS: Mounted root (ext3 filesystem) on device 179:2.
Freeing init memory: 172K

######################
Comment 3 Liming Wang 2011-01-13 18:59:15 UTC
I have test some targets and The test result shows below:

a. On qemuppc, the first time:
real    6m3.032s

The second time:
real    1m30.924s

b. On qemuarm, the first time:
real    2m17.204s

The second time:
real    0m52.896s

c. On omap3530 platform, the first time:
1m30s

The second time:
0m20s

I think it's not a real problem. 
1. Booting sdk rootfs on any target needs more time on the first time. Because the graphics enviroment will initialize some components before the first using.

2. qemuppc is a qemu target, and its simulation speed is a bit lower than qemuarm.

3. qemuppc has no framebuffer, so when it starts Xserver, it will wait matchbox to timeout, which will waste more than 40s. The Xserver startup log is following:

Starting Xserver
fbset: can't open '/dev/fb0': No such file or directory
fbset: can't open '/dev/fb0': No such file or directory
fbset: can't open '/dev/fb0': No such file or directory

_XSERVTransSocketOpenCOTSServer: Unable to open socket for inet6
_XSERVTransOpen: transport open failed for inet6/qemuppc:0
_XSERVTransMakeAllCOTSServerListeners: failed to open listener for inet6
Error opening framebuffer /dev/fb0: No such file or directory

Fatal server error:
no screens found
giving up.
xinit:  Connection refused (errno 111):  unable to connect to X server
xinit:  No such process (errno 3):  Server error.      

Timeout waiting for org.matchbox_project.desktop.Loaded


I think we can do nothing for this bug.
Comment 4 Bruce Ashfield 2011-01-13 20:34:59 UTC
Liming: thanks for the update, this matches what I've seen as well.

What are your timings for a minimal image boot ? Mine are taking less
than a minute for all emulated targets.

We can also strip down the qemuppc run to not have graphics, since
adding a framebuffer driver to qemuppc still eludes us.

Comments ? I concur with Liming that there is very little we can do here.
Comment 5 Liming Wang 2011-01-13 21:43:48 UTC
For  minimal image, I just tested qemuppc and qemuarm, all only waste less than 30s.
Comment 6 Bruce Ashfield 2011-02-15 06:11:27 UTC
Changing the state of this to accepted, but reducing the
importance of this one. Since as the discussion states, it 
is fine with a minimal image, and the slow startup is due
to missing graphics h/w for qemuppc.
Comment 7 Bruce Ashfield 2011-03-03 17:46:43 UTC
This won't be fixed for M4 (see the last comment), it is somehow
related to the X component of anything but the minimal image. That
is out of the kernel/BSP hands, so there's nothing we can do here.
Comment 8 Bruce Ashfield 2011-03-07 11:32:10 UTC
bumping to 1.1 when we'll have a chance to address qemuppc graphics.
Comment 9 Richard Purdie 2011-08-05 07:21:43 UTC
Is this any better with the 3.0 kernel and associated fixes?
Comment 10 Bruce Ashfield 2011-08-05 11:28:08 UTC
much to my displeasure, this is still an issue, the interrupt storm or accessed caused by any graphical startup on the non existent framebuffer slows initial boot down to a crawl. 

This looks like it will have to be addressed with the qemuppc replacement.
Comment 11 Yi Zhao 2011-08-15 01:59:30 UTC
I re-tested some sato images with 20110806 build.
commit info: abdec68876ac7ce1a6d5c223d1757b7e8a14b85f
kernel version: 2.6.37

The results are as below:

1. On qemuppc

The first time:  3m37s
The second time: 1m30s

2. On qemuarm

The first time: 1m6s
The second time: 25s

3. On qemumips

The first time: 1m
The second time: 27s

Although the booting time of qemuppc is less than 4 minutes now, it is still much slower than qemuarm and qemumips.
Comment 12 Richard Purdie 2011-08-15 03:10:51 UTC
Is the timeout in the X startup scripts still an issue? Could we assist things by checking if /dev/fb0 exists somewhere and exiting early if not?
Comment 13 Yi Zhao 2011-08-17 01:37:20 UTC
(In reply to comment #12)
> Is the timeout in the X startup scripts still an issue? Could we assist things
> by checking if /dev/fb0 exists somewhere and exiting early if not?

Yes, the timeout is still an issue.
#############
Starting Xserver
fbset: can't open '/dev/fb0': No such file or directory
fbset: can't open '/dev/fb0': No such file or directory
fbset: can't open '/dev/fb0': No such file or directory

Error opening framebuffer /dev/fb0: No such file or directory

Fatal server error:
no screens found
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
Timeout waiting for org.matchbox_project.desktop.Loaded
###############

I tried to remove the X startup scripts 'S09xserver-nodm' from /etc/rc5.d, then the booting time of qemuppc is 20s ! (not the first time)
Comment 14 Liming Wang 2011-08-18 02:17:44 UTC
following patch changes qemuppc to run into 3 runlevel and doesn't use tty0 as console. It speeds up the boot time to 20s for the second time.

diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
index c15632d..883fa5b 100755
--- a/scripts/runqemu-internal
+++ b/scripts/runqemu-internal
@@ -384,7 +384,7 @@ if [ "$MACHINE" = "qemuppc" ]; then
     BIOS=powerpc_rom.bin
     QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS -nographic"
     if [ "$FSTYPE" = "ext3" -o "$FSTYPE" = "btrfs" ]; then
-        KERNCMDLINE="root=/dev/hda rw console=ttyS0 console=tty0 $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
+        KERNCMDLINE="root=/dev/hda rw console=ttyS0 3 $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
         QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE -M $MACHINE_SUBTYPE -bios $BIOS -hda $ROOTFS -no-reboot $QEM
     fi
     if [ "$FSTYPE" = "nfs" ]; then
@@ -393,7 +393,7 @@ if [ "$MACHINE" = "qemuppc" ]; then
             cleanup
             return
         fi
-        KERNCMDLINE="root=/dev/nfs console=ttyS0 console=tty0 nfsroot=$NFS_SERVER:$NFS_DIR,$UNFS_OPTS rw $KERNEL_NETW
+        KERNCMDLINE="root=/dev/nfs console=ttyS0 3 nfsroot=$NFS_SERVER:$NFS_DIR,$UNFS_OPTS rw $KERNEL_NETWORK_CMD mem
         QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE -M $MACHINE_SUBTYPE -bios $BIOS -no-reboot $QEMU_UI_OPTIONS"
     fi
 fi
Comment 15 Song Liu 2011-08-22 13:35:14 UTC
Liming, is this bug fixed with the patches you mentioned? Are the patches in review? Thanks!
Comment 16 Liming Wang 2011-08-22 19:35:54 UTC
The patch has been passed review. I think this patch will merged into poky later. But I should ask Bruce how to merge the patch.
Comment 18 liang li 2011-09-05 02:22:52 UTC
tried on qemuppc sato image:
first boot time: 2m and 21 seconds.
second boot time: 23 seconds

and runlevel now is 3:
root@qemuppc:~# runlevel
N 3

git commit : 705ec50edda7f7fb8c132238fe3f1477384a470e
git branch : poky/master

test env :
host : ubuntu 10.10 x86_64
kernel :2.6.35-30-generic #56-Ubuntu SMP

test steps : 
1.create toolchain using "bitbake meta-toolchain" command,get toolchain tarball from "tmp/deploy/sdk" subdir of build dir  ,extract to /opt dir of the host machine.
2.run "runqemu" command to boot the sato image.

next weekly test will check again and change the bug status to verified.
Comment 19 liang li 2011-09-09 00:14:19 UTC
(In reply to comment #18)
> tried on qemuppc sato image:
> first boot time: 2m and 21 seconds.
> second boot time: 23 seconds
> 
> and runlevel now is 3:
> root@qemuppc:~# runlevel
> N 3
> 
> git commit : 705ec50edda7f7fb8c132238fe3f1477384a470e
> git branch : poky/master
> 
> test env :
> host : ubuntu 10.10 x86_64
> kernel :2.6.35-30-generic #56-Ubuntu SMP
> 
> test steps : 
> 1.create toolchain using "bitbake meta-toolchain" command,get toolchain tarball
> from "tmp/deploy/sdk" subdir of build dir  ,extract to /opt dir of the host
> machine.
> 2.run "runqemu" command to boot the sato image.
> 
> next weekly test will check again and change the bug status to verified.

verified using M4 RC1 images(nightly build 20110908-5) from:
http://autobuilder.pokylinux.org/nightly/20110908-5/machines/qemuppc/
first boot time : 1 minutes and 45 seconds.
second boot time :22 seconds.