CPU caching of flash regions.

David Woodhouse dwmw2 at infradead.org
Mon May 14 12:17:45 EDT 2001


ebiederman at lnxi.com said:
>  What kind of scenario are we talking about?  Do the pages get read
> multiple times?  Of is it just that that copy_from needs to be more
> highly optimized like memcpy?  I suspect that before the whole
> interface changes you should experiment and see what really needs to
> be done.

This is during the initial mount of JFFS2. Nothing should be read twice - 
but we should at least be able to fill cache lines and do burst reads from 
the flash chips, shouldn't we?

> As for interface changes I would suggest an additional opertation
> memory_barrier that forces the flush if needed.  

The original plan involved no interface changes - I was suggesting that the 
map driver would DTRT with the caches internally.

> But I really think you should be able to get it working faster simply
> by optimizing the copy_from routine.

Most of the copy_from routines use memcpy_fromio(), which on i386 is just 
a memcpy(). It ought to be fairly close to optimal.

Actually, the board used for the offending profile is a board with paged 
access to the flash, so it's slightly slower than some others - but the 
overhead shouldn't be too high. And the cache benefit would be more limited.

--
dwmw2






More information about the linux-mtd mailing list