public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] ext4 and caching
@ 2016-03-16 18:42 Eric Nelson
  2016-03-16 21:40 ` [U-Boot] [RFC PATCH 0/2] simple cache layer for block devices Eric Nelson
  2016-03-19 15:42 ` [U-Boot] ext4 and caching Ioan Nicu
  0 siblings, 2 replies; 20+ messages in thread
From: Eric Nelson @ 2016-03-16 18:42 UTC (permalink / raw)
  To: u-boot

	Hi all,

I've been seeing the same sort of issues repoted by Ionut
and as addressed by this patch:
	http://lists.denx.de/pipermail/u-boot/2014-January/171459.html

That patch was added in commit fc0fc50 and reverted in commit 715b56f.

It no longer applies cleanly, and when I tried to resurrect it,
I saw errors traversing directories and perhaps something went
wrong with my merge.

Ionut, do you have a current version of this patch?

When I looked a little further, I found that a read of a ~150 MiB
was around 30x slower than typical, and that the **same** 8 blocks
accounted for the majority of the reads.

In fact, these same blocks were read back-to-back.

The following is a quick picture of the output from a simple
printf in mmc_bread of the block number and count during a
load of the problem file.

~$ uniq -c < mmc_bread.log | sort -n
      1 mmc_bread: 0/1
      1 mmc_bread: 2293760/1
      1 mmc_bread: 2293762/2
      1 mmc_bread: 2293768/1
      1 mmc_bread: 2293768/1
      1 mmc_bread: 2293768/1
      1 mmc_bread: 2293768/1
      1 mmc_bread: 2295264/1
      1 mmc_bread: 2295270/1
      1 mmc_bread: 2295290/1
      1 mmc_bread: 2295645/1
      1 mmc_bread: 7536640/131072
      1 mmc_bread: 7667712/32768
      1 mmc_bread: 7700480/16384
      1 mmc_bread: 7729152/65536
      1 mmc_bread: 7798784/130722
      1 mmc_bread: 7929506/1
      1 mmc_init: 0, time 129
      2 mmc_bread: 0/1
      6 mmc_bread: 2359120/1
     10 mmc_bread: 2358752/1
     34 mmc_bread: 2358808/1
   2048 mmc_bread: 2557936/8
   4096 mmc_bread: 2557936/8
   8193 mmc_bread: 2557936/8
  16340 mmc_bread: 2557936/8
  16384 mmc_bread: 2557936/8

~$ sort < mmc_bread.log | uniq -c | sort -n | tail -n 1
  47061 mmc_bread: 2557936/8

In English, the 8 blocks starting@2557936 are read
47061 times, and back to back in large (2k/4k/16k) bunches,
so a very simple **single** block cache of the last read
will fix the speed issue and I hacked something up to
verify that.

Is anybody else working on things in this area?

I think this is something that's probably easier to fix
at the block device level rather than within the ext4
filesystem code.

That said, the 2k/4k/16k bunches above may also indicate
a simpler fix in the ext4 code.

Please chime in with your thoughts.

Regards,


Eric Nelson

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2016-04-10 14:31 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-16 18:42 [U-Boot] ext4 and caching Eric Nelson
2016-03-16 21:40 ` [U-Boot] [RFC PATCH 0/2] simple cache layer for block devices Eric Nelson
2016-03-16 21:40   ` [U-Boot] [RFC PATCH 1/2] add block device cache Eric Nelson
2016-03-17 21:16     ` Stephen Warren
2016-03-17 21:33       ` Eric Nelson
2016-03-17 21:41         ` Stephen Warren
2016-03-20 22:13         ` Tom Rini
2016-03-20 22:51           ` Eric Nelson
2016-03-16 21:40   ` [U-Boot] [RFC PATCH 2/2] mmc: add support for " Eric Nelson
2016-03-17 21:23     ` Stephen Warren
2016-03-20 19:35       ` Eric Nelson
2016-03-20 22:13         ` Tom Rini
2016-03-20 22:54           ` Eric Nelson
2016-03-21 18:31             ` Eric Nelson
2016-03-26  0:11               ` Eric Nelson
2016-04-09 17:55             ` Simon Glass
2016-04-10 14:31               ` Eric Nelson
2016-03-21 14:27         ` Eric Nelson
2016-03-19 15:42 ` [U-Boot] ext4 and caching Ioan Nicu
2016-03-20 15:02   ` Eric Nelson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox