Skip to content

Add cache for block devices

Eric Nelson u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 3 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 3 patches the cover letter announces are in this archive.

Reviews trailers per patch

PatchTom RiniStephen Warren
SeriesR-b R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [U-Boot] [PATCH 0/3] Add cache for block devices

Patch 1 is the block cache implementation.

Patches 2 and 3 update the mmc and sata commands to use the new blk_dread/dwrite/derase routines and can be applied separately.

Notable changes since the V2 RFC patch set include:
- renaming of files and routines to use "blkcache" rather than "cache_block" to make things consistent with the command name.

- implemented through the blk_dread/dwrite/derase routines in blk.h instead of drivers/mmc.

- added detection of device (re)initialization in disk/part.c

- changed the default max blocks/entry and entries to 2 and 32 respectively based on further testing.

- changed to sub-command implementation as suggested by Stephen Warren.

- changed interface to cache_find per Stephen's suggestion

I tested with and without DM and compile-tested with CONFIG_BLK enabled, but only on MMC and USB devices.

As a teaser, here are some performance numbers loading a 5MiB file from SD card.

With cache:

	=> blkc max 2 32                            
	changed to max of 32 entries of 2 blocks each
	=> load mmc 0:2 10008000 /usr/lib/libGAL.so
	5042083 bytes read in 251 ms (19.2 MiB/s)

Without cache:

	=> blkc max 0 0                            
	changed to max of 0 entries of 0 blocks each
	=> load mmc 0:2 10008000 /usr/lib/libGAL.so
	5042083 bytes read in 4638 ms (1 MiB/s)

Eric Nelson (3):
drivers: block: add block device cache
mmc: force mmc command to go through block layer
sata: force sata reads and writes to go through block layer

 cmd/mmc.c                  |   7 +-
 cmd/sata.c                 |   6 +-
 disk/part.c                |   2 +
 drivers/block/Kconfig      |  20 ++++
 drivers/block/Makefile     |   1 +
 drivers/block/blk-uclass.c |  13 +-
 drivers/block/blkcache.c   | 293 +++++++++++++++++++++++++++++++++++++++++++++
 include/blk.h              |  79 +++++++++++-
 8 files changed, 414 insertions(+), 7 deletions(-)
 create mode 100644 drivers/block/blkcache.c
Signature · 1 line
2.6.2