[RFC] UBI statistics and bitrot interface

Zhihao Cheng chengzhihao1 at huawei.com
Fri Feb 14 20:58:20 PST 2025


在 2025/2/15 0:04, Ashley Herron 写道:
>> IIRC, this patches have been part of our failed approach to support MLC
>> NAND. One part was exposing a more or less sophisticated interface
>> to userspace such that a NAND flash specific daemon can foster the chip.
>>
>>
>> After some iterations, ubihealthd was born. But it does not use a statistics
>> interface.
> 
> Unfortunately ubihealthd wouldn't fit what we need.
> 
>>
>> What kind of metrics are you looking for?
>> Maybe some eBPF/tracing magic will already serve you enough data points?
> 
> The goal is to capture similar data as eMMC and UFS devices report regarding
> total bytes written to the block device. So I want to capture total (payload)
> bytes written by callers to the UBI layer, not including UBI overhead (headers,
> wear leveling). This is for the purpose of monitoring and identifying any
> pattern of excessive writing on devices in operation that may effect its
> lifetime. 

> We may want to monitor total writes to a UBI device over a 24 hour
> periods or less, so only using erase counter monitoring doesn't give us the
> level of monitoring we require. We write to some UBI volumes using UBIFS
> and others using UBI IO directly. I was planning to add (or request you add) a
> wc (write count) variable to the current struct with ec and rc in this patchset.
> 

I think ebpf/tracing will satisfy your requirements by hooking function 
ubi_eba_write_leb().

> Cheers,
> Ashley
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
> .
> 




More information about the linux-mtd mailing list