u-boot/fs
Evan Thompson a12a49cf05 ext4fs: Add ext4 extent tree cache
In ext4, the file inode can store up to 4 extents. If a file requires
more (due to size or fragmentation), an extent index tree is used.

Currently, u-boot reads a node from each level of the extent tree
for every block read, which is very inefficient when extent tree
depth is > 0.

This patch adds a cache for the extent tree. We cache the 1
most-recently-seen node at each extent tree level. The typical workload
is sequential block access, so once we leave a given tree node, it will
not be revisited. Therefore, it makes sense to just cache one node
per tree level.

Cached blocks are lazily allocated. The typical case is extent tree
depth = 0, in which case no caching is needed and no allocations will
occur.

For files with extent tree depth = 1, this patch produces a ~10x
improvement in read speed. For deeper extent trees, the improvement is
larger. On my test device, a 3MB file which previously took 9s to read
now takes 150ms.

Cache size is configurable with CONFIG_EXT4_EXTENT_CACHE_SIZE. However
the default of 5 (the maximum depth of well-formed extent trees) is
recommended.

Signed-off-by: Evan Thompson <evan.thompson@flukenetworks.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Cherry-picked-by: Alexandre Bard <alexandre.bard@netmodule.com>
2020-01-12 21:38:02 +01:00
..
btrfs fs: btrfs: Fix printf format character warning 2018-01-29 12:50:08 -05:00
cbfs fs: Kconfig: Add a separate config for FS_CBFS 2017-04-30 13:40:57 -04:00
cramfs fs: Kconfig: Add a separate option for FS_CRAMFS 2017-04-30 13:40:59 -04:00
ext4 ext4fs: Add ext4 extent tree cache 2020-01-12 21:38:02 +01:00
fat MLK-20668-2 fat: Fix issue in rootdir table flush for FAT16/12 2019-01-03 19:31:05 -08:00
jffs2 fs/jffs2/mini_inflate.c: use "static inline" instead of "inline" 2017-10-16 09:42:51 -04:00
reiserfs fs: Create a common fs_devread for ext4/reiserfs/zfs 2017-10-02 21:51:50 -04:00
sandbox sandboxfs: Fix resource leak 2016-12-02 10:37:47 -07:00
ubifs ubifs: no NULL check needed before free 2017-11-20 10:13:33 +01:00
yaffs2 yaffs2: iterator variable cannot be NULL 2018-03-09 12:31:06 -05:00
zfs fs: Create a common fs_devread for ext4/reiserfs/zfs 2017-10-02 21:51:50 -04:00
Kconfig fs: btrfs: Add U-Boot fs handlers. 2017-10-02 21:52:18 -04:00
Makefile fs: btrfs: Add U-Boot fs handlers. 2017-10-02 21:52:18 -04:00
fs.c fs: remove distractive message in fs_read() 2018-01-19 15:49:28 -05:00
fs_internal.c fs: avoid possible NULL dereference in fs_devread 2017-11-29 22:30:50 -05:00