[U-Boot] 'load mmc' speed varies significantly

Marek Vasut marek.vasut at gmail.com
Sat Nov 10 12:35:56 UTC 2018


On 11/10/2018 09:37 AM, Jan Kiszka wrote:
> Hi all,
> 
> I'm getting significant speed differences while loading kernel and
> initrd from an ext4 rootfs on an SD card via the 'load' command:
> 
> ## Executing script at 80000000
> 54764 bytes read in 296 ms (180.7 KiB/s)
> 12359688 bytes read in 42982 ms (280.3 KiB/s)
> 4333462 bytes read in 441 ms (9.4 MiB/s)
> 
> The script just does
> 
> setenv bootargs root=/dev/mmcblk1p2 rw rootwait
> load ${devtype} ${devnum}:2 ${fdt_addr_r} /usr/lib/linux-image-4.14.67+/${fdtfile}
> load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} /boot/vmlinuz-4.14.67+
> load ${devtype} ${devnum}:${distro_bootpart} ${ramdisk_addr_r} /boot/initrd.img-4.14.67+
> booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
> 
> So, the kernel takes an eternity while the initrd on the very same
> filesystem loads at full speed. Moreover, when I rewrite the kernel like
> this
> 
> # cat /boot/vmlinuz-4.14.67+ > /boot/vmlinuz-4.14.67+.rewrite                                                                                                                                                                 
> # mv /boot/vmlinuz-4.14.67+.rewrite /boot/vmlinuz-4.14.67+                                                                                                                                                                    
> 
> the transfer speed is fine for it as well.
> 
> I'm currently seeing this on an AM65xx (downstream U-boot, 2018.01-
> based), but I had the very same effect on other boards (e.g. Orange Pi
> Zero) with upstream U-boot as well in the past. We generate the
> filesystem and the SD card image via wic - possibly with some
> unfortunate parameters?

Do you have CONFIG_BLOCK_CACHE=y ? It allows U-Boot to cache inode
content, so it won't have to read them over and over from the storage,
which introduces a lot of overhead.

-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list