MTD/flash perfomance statistics

Artem Bityutskiy dedekind at infradead.org
Tue Dec 2 04:26:19 EST 2008


On Fri, 2008-11-21 at 10:41 -0800, Bruce_Leonard at selinc.com wrote:
> Okay, a bit more info has trickled in from the application guys.  We don't 
> know exactly what we want, but something is better than nothing :).  What 
> we're looking for is information regarding how often we're 
> reading/writting the flash, how many factory bad blocks there are, how 
> many bad blocks have developed over time.

Well, this should be MTD feature, not UBI/UBIFS feature. And if you want
to preserve I/O statistics over reboots, you have to save it on flash,
which is not light-weight anymore.

>   We want to be able to make a 
> rough estimate of how long a part is going to last, based on the part 
> itself (i.e., number of bad blocks)

There is maximum erase counter available in /sys/class/ubi/ubi0/max_ec,
which you may use to judge how close the flash to EOL.

/sys/class/ubi/ubi0/bad_peb_count - count of bad PEB on the MTD device
this UBI device sits on. It includes both factory-marked and dynamically
appeared. There is way to distinguish between factory and non-factory
bad blocks in MTD.

/sys/class/ubi/ubi0/reserved_for_bad tells you number of eraseblocks
reserved for bad block handling. If it becomes zero, you may have
troubles when the next bad block appears, so you may watch this value as
well.

>  and any given customer's usage of the 
> product (i.e., how often is the part being accessed, how many new bad 
> blocks have developed, how well is the UBI wear leveling working)

Well, it is easy to add more statistics, but preserving it between
reboots is not easy.


>  wich 
> will vary from customer to customer depending on how they're using the 
> product.  It doesn't have to be anything sophisticated and I think 
> primarily what the app guys are after are things that UBI probably already 
> tracks for the wear leveling (i.e., number of writes and bad blocks).

Well, loot at the above sysfs-provided info, may be it is enough?

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)




More information about the linux-mtd mailing list