Re: JFFS2 - flash lifetime estimate - Embedded

This is a discussion on Re: JFFS2 - flash lifetime estimate - Embedded ; gcartabia wrote: > I'm using a JFFS2 filesystem on a NOR flash. > > these are the features of my system: > - the flash size is 32MB with 256 erase blocks; > - block size is 128KB; > - ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Re: JFFS2 - flash lifetime estimate

  1. Re: JFFS2 - flash lifetime estimate

    gcartabia wrote:
    > I'm using a JFFS2 filesystem on a NOR flash.
    >
    > these are the features of my system:
    > - the flash size is 32MB with 256 erase blocks;
    > - block size is 128KB;
    > - erase per blocks are 100,000;
    > - most files on filesystem are static;
    > - there is only one dynamic file;
    > - this file is fixed size (about 512KB);
    > - the file is binary and record based;
    > - every record in the file is 44 byte;
    >
    > A single operation on the file writes a record sequentially. When it
    > reaches the end of the file restarts to write from the first record.
    >
    > If I have 10,000 operations per day, how can I estimate the lifetime of
    > my system?


    Assuming the flash is full and there are no spare sectors, a very rough
    back of the envelope calculation would suggest that you can write a
    total of ~11915 (512KB/44) records before you need to erase all four
    blocks and start again. Let's round this up and say that you will need
    to erase the sectors about 6 times during every 5 day period.

    Since you've got 100,000 erases available, that suggests 100,000 /6 =
    16666 five-day periods or 83333 days (= 228 years).

    In practice it will be a little worse than this due to the overhead; on
    the other hand, JFFS2 does compression. The zlib algorithm that it uses
    works quite well even on small numbers of bytes so, depending on the
    entropy in your data, you may find that you do even better. And, if
    there are spare sectors on the flash, JFFS2 will do wear-levelling so
    the lifetime will be even better.

    In short, it sounds like what you're doing should work just fine.

    GWC

  2. Re: JFFS2 - flash lifetime estimate

    gcartabia wrote:

    >
    > I forgot to say I don't use compression.


    Compression is built-in to JFFS2. In the versions I've seen, it is not
    easy to disable it. Did you hack the JFFS2 code in the kernel ?

    > So the lifetime could be longer, but I'm afraid for the overhead of
    > every single write operation.


    Try asking on linux-mtd, but I would be surprised if the overhead was
    much greater than the data size you're writing.

    One possible way of estimating would be :

    1. cat the MTD device containing the JFFS2 MTD device to a file
    2. execute one record update operation.
    3. cat the MTD device, this time to another file

    by doing hexdumps of the files generated in steps 1 and 3, and diffing,
    you should be able to see how many bytes changed when one record was
    updated. Rinse and repeat to get an idea of the average change.


+ Reply to Thread