Re: [PATCH v3 02/10] ubi: Expose mean erase counter for fastmap in sysfs

Rickard x Andersson
2024-11-07T12:21:34Z

On 11/7/24 12:31, Richard Weinberger wrote:
> ----- Ursprüngliche Mail -----
>> Von: "Rickard x Andersson" <rickaran@axis.com>
>> An: "richard" <richard@nod.at>, "Rickard X Andersson" <rickard.andersson@axis.com>
>> One of my devices have the following status:
>>
>> /sys/class/ubi/ubi1 # cat max_ec_data
>> 4672
>> /sys/class/ubi/ubi1 # cat mean_ec_fastmap
>> 8869
>>
>> If you combine the mean EC values you will not be able to tell that the
>> fastmap area is much more worn down. For example the wear of your
>> fastmap area could be on the verge of breaking the flash but that will
>> not be seen on a mean value that includes both the fastmap and data area.
>>
>> If fastmap is not enabled on your system then mean_ec_fastmap will not
>> be visible in sysfs.
>
> But does the user application care?
> Let me ask differently, what is the purpose of exposing these numbers?
> If you just want to know how much your flash is aged, combined max/mean
> ec counters will do it.
>
> For debugging fastmap specific issues, the detailed info via debugfs will do it.
>
> I'm totally fine with exposing more counters, we just need to be clear
> about their meaning and use case. Especially in sysfs we must not make a mess.
>
> Thanks,
> //richard

It is for diagnostics. For example, if you have 100 devices running you
might want to know if some of them are about to be worn down. If you
know that you can take action before they actually break down. One
action could be to for example replace the device in that case.
Since the devices are operate in the "field" it is recommended avoid
using debugfs due to security concerns.

A device might break down due to heavy wear of just the fastmap area.

Thanks,
Rickard A.