[U-Boot] [PATCH] block: Have BLOCK_CACHE default to y in some cases

Tom Rini trini at konsulko.com
Mon May 14 22:13:27 UTC 2018


When dealing with filesystems that come from block devices we can get a
noticeable performance gain in some use cases from having the block
cache enabled.  Do so by default for btrfs/ext4/FAT.

Signed-off-by: Tom Rini <trini at konsulko.com>
---
In general this grows U-Boot itself by ~2KiB and does grow SPL by ~540
bytes when we have it present.  This is only seemingly true when we have
CONFIG_SPL_BLK and in turn block devices and filesystems.  I'm not
opposed to introducing CONFIG_SPL_BLOCK_CACHE down the line if needed,
but I don't think we need it to start with.
---
 drivers/block/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index 15fd1bcb2b7e..a7f4bbfb7bb9 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -29,7 +29,8 @@ config SPL_BLK
 
 config BLOCK_CACHE
 	bool "Use block device cache"
-	default n
+	depends on BLK
+	default y if FS_BTRFS || FS_EXT4 || FS_FAT
 	help
 	  This option enables a disk-block cache for all block devices.
 	  This is most useful when accessing filesystems under U-Boot since
-- 
2.7.4



More information about the U-Boot mailing list