Discussion:
[U-Boot] [PATCH] drivers: block: Allow to cache 4K blocks by default
Jan Kiszka
2018-12-09 08:55:18 UTC
Permalink
The default settings of the block cache so far only allow to hold single
1K blocks. However, larger filesystems tend to use 4K. Failing to cache
those massively degrades access performance unless you manually tune the
cache first. This is not desirable.

Signed-off-by: Jan Kiszka <***@siemens.com>
---

My "load mmc is slow" problem reappeared on AM65xx after growing the
rootfs to almost 1 GB - despite an active block cache.

drivers/block/blkcache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/blkcache.c b/drivers/block/blkcache.c
index 294511fcdb..1fa64989d3 100644
--- a/drivers/block/blkcache.c
+++ b/drivers/block/blkcache.c
@@ -24,7 +24,7 @@ struct block_cache_node {
static LIST_HEAD(block_cache);

static struct block_cache_stats _stats = {
- .max_blocks_per_entry = 2,
+ .max_blocks_per_entry = 8,
.max_entries = 32
};
--
2.16.4
Jan Kiszka
2018-12-10 06:18:02 UTC
Permalink
Post by Jan Kiszka
The default settings of the block cache so far only allow to hold single
1K blocks. However, larger filesystems tend to use 4K. Failing to cache
those massively degrades access performance unless you manually tune the
cache first. This is not desirable.
I submitted the same patch before [1], oddly enough it was not picked by
Tom.
Maybe because the follow-up discussion felt like the topic didn't settle? I
would vote for resolving this 4K think first, because it's very real. OTW: You
patch should go in first of all, then better solutions can be developed on top.

Jan
[1]
http://u-boot.10912.n7.nabble.com/PATCH-RFC-blk-Increase-cache-element-size-td337975.html
Post by Jan Kiszka
---
My "load mmc is slow" problem reappeared on AM65xx after growing the
rootfs to almost 1 GB - despite an active block cache.
drivers/block/blkcache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/blkcache.c b/drivers/block/blkcache.c
index 294511fcdb..1fa64989d3 100644
--- a/drivers/block/blkcache.c
+++ b/drivers/block/blkcache.c
@@ -24,7 +24,7 @@ struct block_cache_node {
static LIST_HEAD(block_cache);
static struct block_cache_stats _stats = {
- .max_blocks_per_entry = 2,
+ .max_blocks_per_entry = 8,
.max_entries = 32
};
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
Tom Rini
2018-12-10 12:28:11 UTC
Permalink
Post by Jan Kiszka
The default settings of the block cache so far only allow to hold single
1K blocks. However, larger filesystems tend to use 4K. Failing to cache
those massively degrades access performance unless you manually tune the
cache first. This is not desirable.
I submitted the same patch before [1], oddly enough it was not picked by
Tom.
[1]
http://u-boot.10912.n7.nabble.com/PATCH-RFC-blk-Increase-cache-element-size-td337975.html
Based on a quick re-read, I had filed that patch as "Marek says he'll
look into a more complex but general scheme". If that's not the case
then yes, we can just do that. Thanks!
--
Tom
Loading...