u-boot/fs/ext4
Evan Thompson 631ba313ea 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>

BugzID: 57904
2020-01-12 21:59:54 +01:00
..
Kconfig ext4fs: Add ext4 extent tree cache 2020-01-12 21:59:54 +01:00
Makefile
crc16.c
crc16.h
dev.c fs: Create a common fs_devread for ext4/reiserfs/zfs 2017-10-02 21:51:50 -04:00
ext4_common.c ext4fs: Add ext4 extent tree cache 2020-01-12 21:59:54 +01:00
ext4_common.h treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
ext4_journal.c fs: ext4: Fix journal overrun issue reported by Coverity 2017-08-26 14:56:13 -04:00
ext4_journal.h ext4: fix endianess problems in ext4 write support 2016-09-23 09:02:04 -04:00
ext4_write.c ext4: Respect group descriptor size when adjusting free counts 2016-09-23 09:20:16 -04:00
ext4fs.c ext4: recover from filesystem corruption when reading 2017-11-20 09:58:31 +01:00