[PATCH] avoid unnnecessary mtd read when read can be satisfied by write buffer
dwmw2 at infradead.org
Thu Jun 1 10:39:34 EDT 2006
On Thursday 01 June 2006 15:32, Jörn Engel wrote:
> Not sure whether this micro optimization is worth the code. A real
> solution would be to have a cache for the full device. Possibly read
> the device through pagecache somehow (writing obviously should be
> write-through, not write-back). That would have a significantly
> higher hit rate than your patch.
We haven't written to the device yet, at this point -- this is just the case
where the data in question exist _only_ in the wbuf, but we're actually
reading from the flash first _anyway_, with the current code.
I don't think that caching the compressed nodes from the flash is going to be
particularly useful -- we already have the page cache for _uncompressed_
data. For other things we might want to cache, such as dirents and symlinks,
we'll do _much_ better to store that in memory for ourselves rather than just
caching whole pages of the backing store for such sparse content.
More information about the linux-mtd