public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: ebiederman@lnxi.com (Eric W. Biederman)
To: David Woodhouse <dwmw2@infradead.org>
Cc: linux-mtd@lists.infradead.org, ajlennon@arcom.co.uk
Subject: Re: CPU caching of flash regions.
Date: 14 May 2001 09:51:36 -0600	[thread overview]
Message-ID: <m38zk07wtz.fsf@DLT.linuxnetworx.com> (raw)
In-Reply-To: David Woodhouse's message of "Mon, 14 May 2001 15:15:25 +0100"

David Woodhouse <dwmw2@infradead.org> writes:

> I've just seen profiling of a system mounting JFFS2 filesystem which shows 
> that the majority of the time is spend in the map driver's copy_from 
> function.
> 
> The copy_from() functions are currently using a completely uncached mapping 
> of the flash chip, but in fact for reading the chip that's not strictly 
> necessary. This is especially true during the initial scan. 
> 
> I think we ought to allow map drivers to do intelligent caching of bus 
> accesses. Suggested semantics:
> 
>  1. Only the copy_from() and copy_to() functions can use a cacheable mapping.
> 
>  2. Any access to the chip through one of the other ({read,write}{8,16,32}) 
> 	functions causes the cache to be flushed for the entire mapping.
> 
> If a cache flush is expensive, a mapping driver may optimise the flushes and
> perform a cache flush only if the cache is expected to be non-empty.
> 
> This approach is fairly simple, and allows mapping drivers to do something 
> closely approximating the "right thing" without adding complexity to the 
> chip driver code. An alternative, which I'm dubious about, is to add 
> explicit cache management functionality to the methods exported by the 
> mapping drivers, and to have the chip driver explicitly turn the cache 
> on/off and flush parts of it when writing/erasing.
> 
> Comments?

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.

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

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

Eric

  reply	other threads:[~2001-05-14 15:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-14 14:15 CPU caching of flash regions David Woodhouse
2001-05-14 15:51 ` Eric W. Biederman [this message]
2001-05-14 16:17   ` David Woodhouse
2001-05-14 16:32     ` Eric W. Biederman
2001-05-15 10:46       ` Alex Lennon
2001-05-15 14:32         ` Eric W. Biederman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m38zk07wtz.fsf@DLT.linuxnetworx.com \
    --to=ebiederman@lnxi.com \
    --cc=ajlennon@arcom.co.uk \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox