Re: Implementing writepage

Charles Manning
2003-10-26T20:48:22Z

On Sunday 26 October 2003 23:25, David Woodhouse wrote:
> On Sun, 2003-10-26 at 11:40 +1300, Charles Manning wrote:
> > It's a matter of what software they're using. Debian apt-get is the
> > current woesome application. Some people have vast YAFFS fs (512Mbytes or
> > more) and are starting to think of it as a real disk equivalent rather
> > than just a little pokey place to store a few configs. This means they
> > want to run regular software.
>
> While obviously YAFFS exists because you don't always make the same
> choices as me, I'd encourage you to resist calls to implement shared
> writable mmap on flash, or at least to make it an optional feature which
> is omitted by default. Otherwise, people might actually use it :)
>
> The life time of flash is limited, and users should endeavour to reduce
> the number of writes even if the media become big enough that the rest
> of the pain of using flash is alleviated.
>
> Shared writable mmap can cause a rewrite of a whole page every time a
> single byte is changed; explicit writes are almost always going to be a
> more efficient use of the flash.
>
> Your file system is not broken; your application author is. Mend that
> instead. :)

I disagree David, to an extent. Sure a change of a single byte can cause the
rewrite of a whole page, but you can also cause the same thing with a poorly
written application using write(). mmap is not inherently at fault. I do
however agree that mmap is, in general, not the best way to construct apps
for flash friendliness.

I think too that the attitude to tell people to go rewrite apps for flash is
not really GoodForm(tm). Doing limited mmap with a few apps here and there is
not going to hurt YAFFS. Why embed Linux if you're going to have to scratch
through all utils to pull out the mmaps?

Yes, the lifetime of flash is limited, but I've done accelerated lifetime
tests (30GB or so of writes) and others have done way more than this (twenty
or 30 times). NAND flash, with YAFFS, is unlikely to wear out in most
embedded usage scenarios, by an order of magnitude or so. Sure, you could
craft an atypical "killer app".

I think it appropriate that YAFFS supports mmap. Now what I want to know is
how to implement it.

BTW: In case others on this list think I'm slagging off at David, you're much
mistaken. I hold him and his work in high regard. It would be a boring world
if we all agreed.

-- CHarles