[PATCH][MTD] mtdpart.c: allow other drivers to get physical address of partition

Jared Hulbert jaredeh at gmail.com
Fri Aug 3 14:39:29 EDT 2007


> > Maybe I wasn't so clear.  Assuming the MTD is going to do an erase you would:
> >
> > (a) zap all page affected by block erase
> > (b) identify all pte's mapped to the affected region
> > (c) modify these pte's so they now trigger a fault
> > (d) wait for completion of erase
> > (c) reestablish valid pte mappings
>
> No need to reestablish them -- they'll fault when they need to, which
> means less work next time you erase. And it'll be a minor page fault,
> which is quite cheap -- it only needs to set up the pte and return.

Correct you don't _need_ to.  I'm not sure how cheap that fault is,
this is definitely just an optimization.

> > If you get a fault it gets routed to the filesystem .fault or
> > something like that.  The .fault routine can:
> > (a) suspend the erase
> > (b) copy the page to RAM
> > (c) update the pte to point to RAM
> > (d) resume the erase
>
> This could lead to all your data pages ending up in RAM, which kind of
> defeats the object of XIP.

Right, the assumption is that the number of fault would be low (not
sure how good that assumption is) and that you would push out all
those pages out of RAM at the end of the erase.



More information about the linux-mtd mailing list