We have discovered a significant performance problem in U-Boot accessing an 
EXT4 file system.    If a large image file happens to be created with more than 
4 extents, file read time increases from a few seconds to several minutes.     
The root cause is the indexed extent block is being re-read tens of thousands 
of times from the underlying device.

In our case, the image file is ~44MB and the underlying device is a MMC SD 
card.    Software updates are performed in Linux, and depending on a particular 
instance of EXT4 block allocations, the image file is created with 3, 4 or 5 
extents.    With 3 or 4 extents (tree depth 0), file reads are fast because the 
extent records are located in the cached i-node and the entire file is read 
with 3 or 4 large MMC block reads.     With 5 extents (tree depth 1), extent 
records are in a separate block referenced by an extent index node.   The 
current U-Boot implementation makes no attempt to cache this block and is 
forced to re-read it for every block of file data (EXT4 block size 1KB).   This 
results in excess of 43000 MMC read operations and boot times so long that the 
system appears to be hung.

Blair Pendleton
Fluke Networks R&D
Colorado Springs, CO, USA

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to